/* Jarvis — Light Corporate (real estate premium) */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #f7f6f2;       /* warm off-white */
  --surface:      #ffffff;
  --surface-2:    #fbfaf7;
  --line:         #e8e4dc;
  --line-soft:    #f0ede5;
  --ink:          #1a1d24;
  --ink-2:        #4a4f57;
  --muted:        #7a7e85;
  --muted-soft:   #b0b3b8;
  --brand:        #1a3a4a;       /* deep teal-navy */
  --brand-2:      #2c5b71;
  --brand-soft:   #e8eef1;
  --accent:       #b88a2b;       /* warm gold */
  --accent-soft:  #fbf3e0;
  --success:      #1f7a4d;
  --success-soft: #e6f2eb;
  --warning:      #c47d1c;
  --warning-soft: #fbf2e1;
  --danger:       #b8362f;
  --danger-soft:  #f6e3e1;
  --info:         #2563a8;
  --info-soft:    #e3edf8;
  --purple:       #6c2bd6;
  --purple-soft:  #f0e6fc;
  --sans:         -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono:         ui-monospace, "SF Mono", "Cascadia Mono", Consolas, Menlo, monospace;
  --shadow-sm:    0 1px 2px rgba(15,20,30,0.05);
  --shadow:       0 2px 8px rgba(15,20,30,0.07);
  --shadow-lg:    0 10px 30px rgba(15,20,30,0.10);
}

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  height: 100%;
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  height: 100%;
  overflow: hidden;          /* body can't scroll — only .content does. Keeps nav pinned. */
  display: flex;
  justify-content: center;
  padding: 28px 0;
}
a { color: inherit; text-decoration: none; }

.phone {
  width: 100%;
  max-width: 430px;
  height: 92vh;
  max-height: 920px;
  background: var(--surface);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(15,20,30,0.04);
  position: relative;
}
@media (max-width: 480px) {
  body { padding: 0; }
  .phone {
    border-radius: 0;
    max-width: 100%;
    height: 100vh;       /* fallback */
    height: 100dvh;      /* dynamic viewport — survives iOS URL-bar collapse */
    max-height: 100dvh;
    box-shadow: none;
  }
}

/* --------------- topbar ------------------ */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; background: var(--surface);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.logo { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo-mark {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.logo-mark svg { width: 100%; height: 100%; display: block; }
.logo-words {
  display: flex; flex-direction: column;
  justify-content: center;
  line-height: 1;
  min-width: 0;
}
.logo-name {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.3px;
  color: var(--ink);
  line-height: 1.05;
}
.logo-sub {
  font-size: 10px;
  color: var(--ink-2);
  letter-spacing: 0.4px;
  font-weight: 600;
  line-height: 1;
  margin-top: 3px;
}
.logo-sep { display: none; }
.logo-agency {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-left: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.badge.live {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.7px;
  color: var(--success);
  background: var(--success-soft);
  padding: 5px 9px;
  border-radius: 5px;
}
.badge.live .dot {
  width: 6px; height: 6px; background: var(--success); border-radius: 50%;
  box-shadow: 0 0 6px var(--success); animation: pulse-dot 1.8s infinite;
}
@keyframes pulse-dot { 0%,100% { opacity: 1 } 50% { opacity: 0.4 } }
.profile {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: white;
  font-weight: 700; font-size: 13.5px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 9px; letter-spacing: 0.4px;
}

/* --------------- system strip ------------------ */
.sys-strip {
  display: flex; background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none;
  font-family: var(--mono); font-size: 11px;
  flex-shrink: 0;
}
.sys-strip::-webkit-scrollbar { display: none; }
.sys {
  padding: 8px 14px; white-space: nowrap;
  color: var(--muted); border-right: 1px solid var(--line);
  display: inline-flex; gap: 6px; align-items: center; letter-spacing: 0.2px;
}
.sys em {
  color: var(--ink); font-style: normal;
  font-variant-numeric: tabular-nums; font-weight: 600;
}
.sys.green em { color: var(--success); }
.sys.red em { color: var(--danger); }
.sys.blue em { color: var(--info); }
.sys.amber em { color: var(--warning); }
.sys.amber { color: var(--warning); }

/* --------------- content scroll area ------------------ */
.content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}

/* --------------- section bar ------------------ */
.section-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 22px 18px 10px;
  font-size: 11.5px; letter-spacing: 1.1px;
  color: var(--muted); text-transform: uppercase; font-weight: 700;
}
.section-bar h2 {
  font-size: 11.5px; font-weight: 700;
  color: var(--muted); letter-spacing: 1.1px;
}
.bracket { display: none; }
.section-meta {
  margin-left: auto;
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.3px; text-transform: none;
  display: flex; align-items: center; gap: 6px;
}
.section-meta a { color: var(--brand); }
.section-meta a:hover { color: var(--accent); }
.section-meta .live-pill {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--success); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px; font-size: 10.5px;
}
.section-meta .live-pill .d {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success); box-shadow: 0 0 5px var(--success);
  animation: pulse-dot 1.8s infinite;
}

/* --------------- KPI tiles ------------------ */
.kpi-row {
  padding: 6px 14px 4px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 9px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px 14px;
  position: relative; overflow: hidden;
  display: block; color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  cursor: pointer;
}
.kpi:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.kpi-label {
  font-size: 11px; letter-spacing: 0.7px;
  color: var(--muted); text-transform: uppercase; font-weight: 700;
}
.kpi-value {
  font-size: 30px; font-weight: 700; color: var(--ink);
  margin-top: 4px;
  display: flex; align-items: baseline; gap: 4px;
  letter-spacing: -0.7px; font-variant-numeric: tabular-nums;
}
.kpi-value small { font-size: 16px; color: var(--muted); font-weight: 500; }
.kpi-trend { font-size: 12px; color: var(--success); margin-top: 5px; font-weight: 600; }
.kpi-trend.amber { color: var(--warning); }
.kpi-trend.red { color: var(--danger); }
.kpi .sparkline {
  position: absolute; bottom: 0; left: 0; right: 0;
  width: 100%; height: 28px; opacity: 0.35; pointer-events: none;
}
.kpi .sparkline polyline {
  fill: none; stroke: var(--brand); stroke-width: 1.6;
  vector-effect: non-scaling-stroke;
}
.kpi.green .sparkline polyline { stroke: var(--success); }
.kpi.red .sparkline polyline { stroke: var(--danger); }
.kpi.blue .sparkline polyline { stroke: var(--info); }

/* Animated KPI counters — scale + color flash on every tick */
#tasksInFlight, #hoursSaved {
  display: inline-block;
  transform-origin: center;
  will-change: transform, color;
}
@keyframes kpi-flash-up {
  0%   { transform: scale(1);    color: var(--ink); }
  35%  { transform: scale(1.10); color: var(--success); }
  100% { transform: scale(1);    color: var(--ink); }
}
@keyframes kpi-flash-down {
  0%   { transform: scale(1);    color: var(--ink); }
  35%  { transform: scale(1.10); color: var(--warning); }
  100% { transform: scale(1);    color: var(--ink); }
}
#tasksInFlight.flash-up, #hoursSaved.flash-up { animation: kpi-flash-up 0.6s ease-out; }
#tasksInFlight.flash-down { animation: kpi-flash-down 0.6s ease-out; }

/* --------------- agent grid ------------------ */
.agent-grid {
  padding: 4px 14px 10px;
  display: grid;
  grid-template-rows: repeat(3, auto);
  grid-auto-flow: column;
  grid-auto-columns: 170px;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.agent-grid::-webkit-scrollbar { display: none; }
.agent-card { scroll-snap-align: start; }
.agent-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 14px 12px;
  color: inherit; display: block;
  position: relative; overflow: hidden;
  min-height: 124px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.agent-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.agent-card .orb {
  display: inline-block; width: 9px; height: 9px;
  background: var(--muted-soft); border-radius: 50%;
  margin-right: 8px; vertical-align: middle; flex-shrink: 0;
}
.agent-card.status-working  .orb, .agent-list .row.status-working  .orb { background: var(--accent); box-shadow: 0 0 6px var(--accent); animation: pulse-dot 1.6s infinite; }
.agent-card.status-approval .orb, .agent-list .row.status-approval .orb { background: var(--info);   box-shadow: 0 0 6px var(--info);   animation: pulse-dot 1.6s infinite; }
.agent-card.status-urgent   .orb, .agent-list .row.status-urgent   .orb { background: var(--danger); box-shadow: 0 0 8px var(--danger); animation: pulse-dot 0.8s infinite; }
.agent-head { display: flex; align-items: center; }
.agent-name { font-size: 14.5px; font-weight: 700; color: var(--ink); letter-spacing: -0.2px; }
.agent-task { font-size: 13px; color: var(--ink-2); margin-top: 8px; line-height: 1.4; }
.agent-meta {
  display: flex; align-items: center; gap: 6px; margin-top: 10px;
  font-size: 11px; letter-spacing: 0.2px;
}
.model-chip {
  padding: 3px 8px; background: var(--accent-soft); border-radius: 5px;
  color: var(--accent); font-family: var(--mono);
  font-size: 10.5px; font-weight: 600;
}
.model-chip.claude-opus-4-7 { background: var(--purple-soft); color: var(--purple); }
.model-chip.gemini-3-1-pro  { background: var(--info-soft); color: var(--info); }
.model-chip.perplexity-sonar-pro { background: var(--success-soft); color: var(--success); }
.queue { color: var(--muted); margin-left: auto; font-family: var(--mono); font-size: 11px; font-weight: 500; }

/* --------------- live feed ------------------ */
.feed-wrap { padding: 0 14px; }
.feed {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  max-height: 360px;        /* ~8 rows */
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--muted-soft) transparent;
}
.feed::-webkit-scrollbar { width: 5px; }
.feed::-webkit-scrollbar-thumb { background: var(--muted-soft); border-radius: 3px; }
.feed::-webkit-scrollbar-track { background: transparent; }
.feed-row {
  display: flex; gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--line-soft);
  font-size: 12.5px; align-items: center;
  color: var(--ink);
  animation: feed-in 0.4s ease-out;
  transition: background 0.12s;
}
.feed-row:first-child { border-top: none; }
.feed-row:hover { background: var(--surface-2); }
@keyframes feed-in { from { opacity: 0; transform: translateY(-4px) } to { opacity: 1; transform: translateY(0) } }
.feed-time {
  color: var(--muted); flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  font-family: var(--mono); font-size: 11px;
  min-width: 60px;
}
.feed-agent { color: var(--brand); flex-shrink: 0; font-weight: 700; }
.feed-model { color: var(--muted); flex-shrink: 0; font-family: var(--mono); font-size: 11px; }
.feed-action {
  color: var(--ink-2); flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.feed-row.tag-urgent .feed-agent { color: var(--danger); }
.feed-row.tag-urgent .feed-time::before { content: "▶ "; color: var(--danger); }
.feed-row.tag-done   .feed-agent { color: var(--success); }
.feed-row.tag-review .feed-agent { color: var(--info); }

/* --------------- approvals ------------------ */
.approvals {
  margin: 14px;
  background: linear-gradient(180deg, var(--accent-soft) 0%, #fbf7ec 100%);
  border: 1px solid #efdcb3;
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  padding: 15px 16px;
}
.approval-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.approval-head .label {
  font-size: 11.5px; letter-spacing: 1px; color: var(--accent);
  font-weight: 700; text-transform: uppercase;
}
.approval-head .count {
  font-size: 11.5px; background: var(--accent); color: white;
  padding: 3px 11px; border-radius: 12px; font-weight: 700;
}
.approval-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-top: 1px solid #ecd9a8;
  gap: 12px; color: var(--ink);
  transition: opacity 0.15s;
}
.approval-row:hover { opacity: 0.85; }
.approval-row:first-of-type { border-top: none; }
.approval-text { font-size: 14px; flex: 1; min-width: 0; font-weight: 600; color: var(--ink); }
.approval-text.priority::before { content: "● "; color: var(--danger); font-size: 12px; }
.approval-text small {
  display: block; font-size: 12px; color: var(--ink-2);
  margin-top: 3px; font-weight: 400;
}
.approval-cta {
  font-size: 11px; padding: 7px 14px;
  background: var(--accent); color: white;
  border-radius: 6px; font-weight: 700;
  letter-spacing: 0.5px; flex-shrink: 0; border: none;
  text-transform: uppercase;
}

/* --------------- integration strip ------------------ */
.intg-strip {
  margin: 0 14px 14px;
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  font-size: 11.5px;
}
.intg-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink-2); font-weight: 600;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.intg-pill .d {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success); box-shadow: 0 0 5px var(--success);
}
.intg-pill.degraded .d { background: var(--warning); box-shadow: 0 0 5px var(--warning); }
.intg-pill.degraded { color: var(--warning); border-color: #efdcb3; }
.intg-pill:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

/* --------------- bottom nav (locked to bottom) ------------------ */
.bottom-nav {
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 8px 0 max(10px, env(safe-area-inset-bottom));
  flex-shrink: 0;
  box-shadow: 0 -2px 10px rgba(15,20,30,0.04);
}
.bottom-nav a {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 4px 4px;
  color: var(--muted);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.3px;
  position: relative;
  transition: color 0.15s;
}
.bottom-nav a:hover { color: var(--brand); }
.bottom-nav .nav-icon {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.bottom-nav .nav-icon svg { width: 22px; height: 22px; display: block; }
.bottom-nav a.active { color: var(--brand); }
.bottom-nav a.active::before {
  content: "";
  position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 28px; height: 3px;
  background: var(--brand);
  border-radius: 0 0 3px 3px;
}

/* --------------- page header ------------------ */
.page-header {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.page-header .crumbs {
  font-size: 11.5px; color: var(--muted);
  letter-spacing: 0.3px; margin-bottom: 5px; font-weight: 500;
}
.page-header .crumbs a { color: var(--brand); font-weight: 600; }
.page-header h1 {
  font-size: 22px; font-weight: 700;
  color: var(--ink); letter-spacing: -0.5px;
}
.page-header .sub { font-size: 13.5px; color: var(--ink-2); margin-top: 5px; }

/* --------------- workforce list ------------------ */
.agent-list .row {
  display: grid; grid-template-columns: auto 1fr auto auto;
  gap: 12px; align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink); background: var(--surface);
  transition: background 0.12s;
}
.agent-list .row:hover { background: var(--surface-2); }
.agent-list .orb { width: 9px; height: 9px; border-radius: 50%; background: var(--muted-soft); }
.agent-list .col-name { font-size: 14.5px; font-weight: 700; }
.agent-list .col-name small {
  display: block; font-size: 12px; color: var(--ink-2);
  font-weight: 400; margin-top: 2px;
}
.agent-list .col-model { font-family: var(--mono); font-size: 11.5px; color: var(--accent); font-weight: 600; }
.agent-list .col-model.claude-opus-4-7 { color: var(--purple); }
.agent-list .col-model.gemini-3-1-pro  { color: var(--info); }
.agent-list .col-model.perplexity-sonar-pro { color: var(--success); }
.agent-list .col-queue { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.agent-list .col-queue em { color: var(--accent); font-style: normal; font-weight: 700; }

/* --------------- agent detail ------------------ */
.metric-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: var(--line);
  border-bottom: 1px solid var(--line);
}
.metric-row .metric { background: var(--surface); padding: 14px 8px; text-align: center; }
.metric-row .metric .v {
  font-size: 20px; font-weight: 700; color: var(--ink);
  letter-spacing: -0.4px; font-variant-numeric: tabular-nums;
}
.metric-row .metric .v.green { color: var(--success); }
.metric-row .metric .v.red { color: var(--danger); }
.metric-row .metric .l {
  font-size: 10.5px; color: var(--muted);
  letter-spacing: 0.5px; margin-top: 4px;
  text-transform: uppercase; font-weight: 700;
}

.task-list .task {
  padding: 13px 18px;
  border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: flex-start; gap: 12px;
}
.task .t-time {
  font-family: var(--mono); font-size: 11.5px;
  color: var(--muted); flex-shrink: 0; padding-top: 2px;
  min-width: 46px; font-weight: 500;
}
.task .t-body { flex: 1; min-width: 0; }
.task .t-title { font-size: 14px; color: var(--ink); font-weight: 600; }
.task .t-meta { font-size: 12px; color: var(--ink-2); margin-top: 4px; }
.task .t-status {
  font-size: 10.5px; padding: 4px 9px; border-radius: 5px;
  flex-shrink: 0; letter-spacing: 0.5px;
  font-weight: 700; text-transform: uppercase;
}
.task .t-status.ok     { background: var(--success-soft); color: var(--success); }
.task .t-status.work   { background: var(--accent-soft);  color: var(--accent); }
.task .t-status.review { background: var(--info-soft);    color: var(--info); }

.queue-list .q-item {
  display: block;
  padding: 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13.5px;
}
.q-summary {
  padding: 13px 18px;
  display: flex; gap: 12px; align-items: center;
  cursor: pointer;
  list-style: none;
  transition: background 0.12s;
}
.q-summary::-webkit-details-marker { display: none; }
.q-summary:hover { background: var(--surface-2); }
.queue-list .q-item[open] > .q-summary { background: var(--surface-2); border-bottom: 1px solid var(--line-soft); }
.queue-list .q-class { font-family: var(--mono); color: var(--accent); flex-shrink: 0; min-width: 145px; font-size: 11.5px; font-weight: 600; }
.queue-list .q-title { color: var(--ink); flex: 1; min-width: 0; font-weight: 500; }
.queue-list .q-target { color: var(--muted); font-size: 12px; }
.q-chevron {
  margin-left: auto;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  font-weight: 400;
  transition: transform 0.18s, color 0.18s;
  flex-shrink: 0;
}
.queue-list .q-item[open] .q-chevron { transform: rotate(90deg); color: var(--brand); }
.q-detail {
  padding: 14px 18px 16px;
  background: var(--surface);
}
.trace-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 12px;
  padding: 5px 0;
  align-items: flex-start;
  font-size: 12.5px;
}
.trace-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.7px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  padding-top: 3px;
}
.trace-value {
  color: var(--ink-2);
  line-height: 1.55;
  word-wrap: break-word;
}

/* === Generic expandable pattern (rows + cards across all pages) === */
details.expandable { display: block; }
details.expandable > summary {
  cursor: pointer;
  list-style: none;
  position: relative;
}
details.expandable > summary::-webkit-details-marker { display: none; }
details.expandable > summary::marker { content: ''; }

.expandable-chevron {
  display: inline-block;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
  transition: transform 0.18s, color 0.18s;
}
details.expandable[open] .expandable-chevron {
  transform: rotate(90deg);
  color: var(--brand);
}

/* Row patterns already flex — chevron sits at end via margin-left auto */
summary.task .expandable-chevron,
summary.list-row .expandable-chevron {
  margin-left: auto;
  align-self: center;
}
details.expandable[open] > summary.task,
details.expandable[open] > summary.list-row {
  background: var(--surface-2);
}
details.expandable[open] > summary.task { border-bottom-color: transparent; }

/* Card patterns are block — chevron absolute top-right */
summary.pipe-card .expandable-chevron,
summary.maint .expandable-chevron,
summary.campaign-card .expandable-chevron {
  position: absolute;
  top: 10px;
  right: 10px;
}
details.expandable > summary.pipe-card,
details.expandable > summary.maint,
details.expandable > summary.campaign-card {
  padding-right: 32px;
}
details.expandable[open] > summary.pipe-card {
  background: var(--surface-2);
  border-radius: 9px 9px 0 0;
  margin-bottom: 0;
}
details.expandable[open] > summary.maint {
  background: var(--surface-2);
  border-radius: 8px 8px 0 0;
}
details.expandable[open] > summary.campaign-card {
  background: var(--surface-2);
}

/* Detail panel — base */
.expandable-detail {
  padding: 14px 18px 16px;
  background: var(--surface-2);
  border-top: 1px solid var(--line-soft);
  animation: detail-open 0.16s ease-out;
}
@keyframes detail-open {
  from { opacity: 0; transform: translateY(-2px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Card detail panels visually continue the card */
details.expandable > summary.maint + .expandable-detail {
  margin: 0 14px 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 12px 14px 14px;
}
details.expandable > summary.pipe-card + .expandable-detail {
  margin: 0 0 5px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 9px 9px;
  padding: 12px 12px 14px;
}
details.expandable > summary.campaign-card + .expandable-detail {
  border-top: 1px solid var(--line);
}

.model-mix { padding: 14px 18px; }
.mix-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 12.5px; }
.mix-row .mix-name { min-width: 145px; font-family: var(--mono); font-size: 11.5px; font-weight: 600; }
.mix-row .mix-name.claude-opus-4-7 { color: var(--purple); }
.mix-row .mix-name.gemini-3-1-pro  { color: var(--info); }
.mix-row .mix-name.perplexity-sonar-pro { color: var(--success); }
.mix-row .mix-name.gpt-5-5-turbo   { color: var(--accent); }
.mix-row .mix-bar {
  flex: 1; height: 9px;
  background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 5px; overflow: hidden;
}
.mix-row .mix-bar > div { height: 100%; background: var(--accent); }
.mix-row .mix-bar > div.claude-opus-4-7 { background: var(--purple); }
.mix-row .mix-bar > div.gemini-3-1-pro  { background: var(--info); }
.mix-row .mix-bar > div.perplexity-sonar-pro { background: var(--success); }
.mix-row .mix-pct {
  color: var(--ink); min-width: 42px;
  text-align: right; font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* --------------- sales pipeline ------------------ */
.pipeline {
  display: flex; overflow-x: auto;
  padding: 16px 14px; gap: 10px;
  scrollbar-width: thin;
}
.pipe-stage {
  flex-shrink: 0; width: 250px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px; padding: 12px;
}
.pipe-stage-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 12.5px; }
.pipe-stage-head .stage-name { color: var(--ink); font-weight: 700; letter-spacing: -0.1px; }
.pipe-stage-head .stage-count {
  background: var(--brand); color: white;
  padding: 2px 11px; border-radius: 12px;
  font-weight: 700; font-size: 11px;
}
.pipe-stage .stage-value { font-size: 11px; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.pipe-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px; padding: 10px 12px;
  margin-bottom: 6px;
  box-shadow: var(--shadow-sm);
}
.pipe-card .addr { font-weight: 700; color: var(--ink); font-size: 13.5px; }
.pipe-card .meta { font-size: 11.5px; color: var(--ink-2); margin-top: 4px; line-height: 1.4; }

.list-row {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
  display: flex; gap: 12px; align-items: center;
  background: var(--surface);
}
.list-row:hover { background: var(--surface-2); }
.list-row .l-time {
  font-family: var(--mono); font-size: 12px;
  color: var(--accent); flex-shrink: 0;
  min-width: 92px; font-weight: 700;
}
.list-row .l-main { flex: 1; min-width: 0; }
.list-row .l-main .l-addr { font-size: 14px; font-weight: 700; color: var(--ink); }
.list-row .l-main .l-meta { font-size: 12px; color: var(--ink-2); margin-top: 3px; }
.list-row .l-side { font-size: 12px; color: var(--ink-2); flex-shrink: 0; font-weight: 600; }
.list-row .l-side em { color: var(--success); font-style: normal; font-weight: 700; }

.campaign-card {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface);
}
.campaign-card .c-head { display: flex; justify-content: space-between; align-items: baseline; }
.campaign-card .c-addr { font-size: 14.5px; font-weight: 700; color: var(--ink); }
.campaign-card .c-trend { font-size: 11.5px; color: var(--success); font-weight: 700; }
.campaign-card .c-trend.flat { color: var(--warning); }
.campaign-card .c-trend.down { color: var(--danger); }
.campaign-card .c-note { font-size: 12px; color: var(--ink-2); margin-top: 3px; }
.campaign-card .c-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; margin-top: 10px; }
.campaign-card .c-stat {
  text-align: center; padding: 7px 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 7px;
}
.campaign-card .c-stat .v { font-size: 13.5px; color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.campaign-card .c-stat .l {
  font-size: 9.5px; color: var(--muted);
  letter-spacing: 0.4px; text-transform: uppercase;
  margin-top: 2px; font-weight: 700;
}

/* --------------- rentals ------------------ */
.portfolio-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line); border-bottom: 1px solid var(--line);
}
.portfolio-strip .p { background: var(--surface); padding: 14px 6px; text-align: center; }
.portfolio-strip .p .v { font-size: 19px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.portfolio-strip .p .v.amber { color: var(--warning); }
.portfolio-strip .p .v.red { color: var(--danger); }
.portfolio-strip .p .v.green { color: var(--success); }
.portfolio-strip .p .l {
  font-size: 10px; color: var(--muted); margin-top: 4px;
  letter-spacing: 0.4px; text-transform: uppercase; font-weight: 700;
}

.kanban-col h3 {
  font-size: 11.5px; letter-spacing: 1px; color: var(--muted);
  padding: 16px 18px 8px; display: flex; align-items: center; gap: 6px;
  text-transform: uppercase; font-weight: 700;
}
.kanban-col h3 .count { color: var(--accent); font-weight: 700; }
.maint {
  margin: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px; padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}
.maint.urgent { border-left: 3px solid var(--danger); }
.maint .m-tag {
  font-size: 10px; color: var(--danger);
  font-weight: 700; letter-spacing: 0.6px;
  margin-bottom: 4px; text-transform: uppercase;
}
.maint .m-addr { font-weight: 700; font-size: 14px; color: var(--ink); }
.maint .m-issue { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; }
.maint .m-meta {
  font-size: 11px; color: var(--muted);
  margin-top: 7px; display: flex; gap: 10px; flex-wrap: wrap;
}
.maint .m-meta .trade { color: var(--brand); font-weight: 700; }
.maint .m-meta .quote { color: var(--success); font-weight: 700; }

/* --------------- architecture page ------------------ */
.arch-section { padding: 18px; border-bottom: 1px solid var(--line); }
.arch-section h3 {
  font-size: 12px; letter-spacing: 1px; color: var(--brand);
  margin-bottom: 12px; font-weight: 700; text-transform: uppercase;
}
.arch-section h3 .meta { color: var(--muted); margin-left: 8px; font-weight: 500; }

.model-table, .routing-table { font-size: 12.5px; }
.model-table .row, .routing-table .row {
  padding: 9px 0;
  border-top: 1px solid var(--line-soft);
  display: grid; gap: 10px; align-items: center;
}
.model-table .row { grid-template-columns: 1.5fr 0.7fr 0.7fr 0.9fr; }
.routing-table .row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); align-items: flex-start; }

/* Routing table breaks out of arch-section padding so it spans the full phone width */
.routing-table { margin: 0 -18px; }
.routing-table .row,
.routing-table .head {
  padding-left: 18px;
  padding-right: 18px;
  gap: 14px;
}
.routing-table .row:nth-of-type(odd):not(.head) { background: var(--surface-2); }
.model-table .head, .routing-table .head {
  color: var(--muted); font-size: 10px;
  letter-spacing: 0.7px; border-top: none;
  padding-bottom: 8px; text-transform: uppercase; font-weight: 700;
}
.model-table .name { color: var(--accent); font-weight: 700; font-family: var(--mono); }
.model-table .name.claude-opus-4-7 { color: var(--purple); }
.model-table .name.gemini-3-1-pro  { color: var(--info); }
.model-table .name.perplexity-sonar-pro { color: var(--success); }
.model-table .v, .routing-table .v { color: var(--ink); font-variant-numeric: tabular-nums; }
.model-table .dim { color: var(--ink-2); }
.routing-table .task { color: var(--ink); font-family: var(--mono); font-size: 11.5px; padding-top: 2px; word-break: break-word; }
.routing-table .route { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.routing-table .primary { color: var(--accent); font-family: var(--mono); font-weight: 700; font-size: 11.5px; word-break: break-word; }
.routing-table .primary.claude-opus-4-7 { color: var(--purple); }
.routing-table .primary.gemini-3-1-pro  { color: var(--info); }
.routing-table .primary.perplexity-sonar-pro { color: var(--success); }
.routing-table .fallback { color: var(--muted); font-family: var(--mono); font-size: 10.5px; padding-left: 4px; word-break: break-word; }

.integration-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.intg {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 9px; padding: 11px 13px;
}
.intg-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 5px; gap: 6px;
}
.intg .intg-cat {
  font-size: 10px; color: var(--brand); letter-spacing: 0.5px;
  text-transform: uppercase; font-weight: 700;
}
.intg-ping {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-2);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-style: normal;
  white-space: nowrap;
}
.intg-ping.degraded { color: var(--warning); }
.intg-pill em {
  font-style: normal;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-family: var(--mono);
  color: inherit;
}
.intg .intg-name { font-size: 13px; color: var(--ink); font-weight: 700; line-height: 1.3; }
.intg .intg-meta { font-size: 11.5px; color: var(--ink-2); margin-top: 6px; line-height: 1.5; }

.phase {
  display: grid; grid-template-columns: auto 1fr;
  gap: 14px; padding: 14px 0;
  border-top: 1px solid var(--line-soft);
}
.phase:first-child { border-top: none; }
.phase .p-label { font-size: 12.5px; color: var(--brand); font-weight: 700; min-width: 115px; }
.phase .p-weeks { font-size: 11px; color: var(--muted); margin-top: 3px; font-weight: 500; }
.phase .p-scope { font-size: 13.5px; color: var(--ink); line-height: 1.55; }

.code-block {
  background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 9px;
  padding: 12px 14px;
  font-family: var(--mono); font-size: 11.5px; line-height: 1.6;
  overflow-x: auto; white-space: pre;
  color: var(--ink-2);
  max-height: 360px; overflow-y: auto;
}

.guardrail {
  background: var(--danger-soft);
  border: 1px solid #f3c5c2;
  border-left: 3px solid var(--danger);
  border-radius: 9px; padding: 14px 16px;
}
.guardrail h4 {
  font-size: 12px; color: var(--danger);
  letter-spacing: 0.7px; margin-bottom: 9px;
  font-weight: 700; text-transform: uppercase;
}
.guardrail ul {
  list-style: none; padding: 0;
  font-size: 13.5px; line-height: 1.7; color: var(--ink);
}
.guardrail li::before { content: "▸ "; color: var(--danger); font-weight: 700; }

/* =================================================================
   Cross-document page transitions — app-like routing between pages.
   Chrome (topbar / sys-strip / bottom-nav) keeps its identity across
   navigations and morphs in place; the content area fades + rises
   gently from below for a native push feel.
   Browsers without View-Transitions API fall back to instant nav.
   ================================================================= */
@view-transition {
  navigation: auto;
}

/* Persistent chrome — named so each is its own transition group and
   morphs (rather than fading) between pages. Positions match across
   routes, so the morph reads as "stays put, no flicker". */
.topbar      { view-transition-name: jv-topbar; }
.sys-strip   { view-transition-name: jv-sysstrip; }
.bottom-nav  { view-transition-name: jv-bottomnav; }

/* The root snapshot is everything not given its own name — i.e. the
   actual page body. Old fades + shrinks a hair; new rises 6px and
   scales up from 0.985 — subtle depth, no slideshow vibe. */
::view-transition-old(root) {
  animation: jv-page-out 200ms cubic-bezier(0.4, 0, 1, 1) both;
}
::view-transition-new(root) {
  animation: jv-page-in 320ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@keyframes jv-page-out {
  to { opacity: 0; transform: scale(0.992); }
}
@keyframes jv-page-in {
  from { opacity: 0; transform: translateY(6px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

/* Chrome groups morph at the same easing for cohesive motion. */
::view-transition-group(jv-topbar),
::view-transition-group(jv-sysstrip),
::view-transition-group(jv-bottomnav) {
  animation-duration: 260ms;
  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Honour reduced-motion: drop to a flat 120ms opacity swap. */
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root) { animation: jv-fade-out 120ms linear both; }
  ::view-transition-new(root) { animation: jv-fade-in  120ms linear both; }
}
@keyframes jv-fade-out { to   { opacity: 0; } }
@keyframes jv-fade-in  { from { opacity: 0; } }

/* =================================================================
   APP POLISH — tactile feedback, entry stagger, micro-interactions.
   Designed to coordinate with the cross-document view-transitions
   above: entry animations are delayed past the ~320ms VT window so
   they're visible AFTER the page snapshot crossfade completes.
   ================================================================= */

/* Suppress mobile default tap-highlight so our own press feedback owns it. */
* { -webkit-tap-highlight-color: transparent; }

/* ---- Universal press-feedback on every interactive surface ---- */
.kpi:active,
.agent-card:active,
.intg-pill:active,
.approval-row:active,
.feed-row:active,
.list-row:active,
.section-meta a:active,
summary.task:active,
summary.list-row:active,
summary.pipe-card:active,
summary.maint:active,
summary.campaign-card:active,
.intg:active {
  transform: scale(0.97);
  transition: transform 80ms ease-out;
}
.bottom-nav a:active {
  transform: scale(0.92);
  transition: transform 60ms ease-out;
}
.approval-cta:active {
  transform: scale(0.94);
  transition: transform 60ms ease-out;
}

/* ---- Entry-animation primitive ---- */
@keyframes app-entry {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Homepage KPI cards cascade in after VT settles ---- */
.kpi-row .kpi {
  opacity: 0;
  animation: app-entry 380ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.kpi-row .kpi:nth-child(1) { animation-delay: 340ms; }
.kpi-row .kpi:nth-child(2) { animation-delay: 400ms; }
.kpi-row .kpi:nth-child(3) { animation-delay: 460ms; }
.kpi-row .kpi:nth-child(4) { animation-delay: 520ms; }

/* ---- Section bars slide up gently after KPIs ---- */
.section-bar {
  opacity: 0;
  animation: app-entry 320ms cubic-bezier(0.2, 0.7, 0.2, 1) 380ms both;
}

/* ---- Agent grid cascade (homepage) ---- */
.agent-grid .agent-card {
  opacity: 0;
  animation: app-entry 320ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.agent-grid .agent-card:nth-child(1) { animation-delay: 540ms; }
.agent-grid .agent-card:nth-child(2) { animation-delay: 580ms; }
.agent-grid .agent-card:nth-child(3) { animation-delay: 620ms; }
.agent-grid .agent-card:nth-child(4) { animation-delay: 660ms; }
.agent-grid .agent-card:nth-child(5) { animation-delay: 700ms; }
.agent-grid .agent-card:nth-child(6) { animation-delay: 740ms; }
.agent-grid .agent-card:nth-child(n+7) { animation-delay: 780ms; }

/* ---- Workforce list rows cascade ---- */
.agent-list .row {
  opacity: 0;
  animation: app-entry 320ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.agent-list .row:nth-child(1) { animation-delay: 380ms; }
.agent-list .row:nth-child(2) { animation-delay: 420ms; }
.agent-list .row:nth-child(3) { animation-delay: 460ms; }
.agent-list .row:nth-child(4) { animation-delay: 500ms; }
.agent-list .row:nth-child(5) { animation-delay: 540ms; }
.agent-list .row:nth-child(6) { animation-delay: 580ms; }
.agent-list .row:nth-child(7) { animation-delay: 620ms; }
.agent-list .row:nth-child(8) { animation-delay: 660ms; }
.agent-list .row:nth-child(n+9) { animation-delay: 700ms; }

/* ---- Sales: pipeline stages cascade in horizontally ---- */
.pipeline .pipe-stage {
  opacity: 0;
  animation: app-entry 320ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.pipeline .pipe-stage:nth-child(1) { animation-delay: 380ms; }
.pipeline .pipe-stage:nth-child(2) { animation-delay: 430ms; }
.pipeline .pipe-stage:nth-child(3) { animation-delay: 480ms; }
.pipeline .pipe-stage:nth-child(4) { animation-delay: 530ms; }
.pipeline .pipe-stage:nth-child(5) { animation-delay: 580ms; }
.pipeline .pipe-stage:nth-child(n+6) { animation-delay: 620ms; }

/* ---- Sales: open homes list-rows cascade ---- */
.list-row {
  opacity: 0;
  animation: app-entry 320ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.list-row:nth-child(1) { animation-delay: 420ms; }
.list-row:nth-child(2) { animation-delay: 460ms; }
.list-row:nth-child(3) { animation-delay: 500ms; }
.list-row:nth-child(4) { animation-delay: 540ms; }
.list-row:nth-child(n+5) { animation-delay: 580ms; }

/* ---- Sales: campaign cards cascade ---- */
.campaign-card {
  opacity: 0;
  animation: app-entry 320ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.campaign-card:nth-of-type(1) { animation-delay: 460ms; }
.campaign-card:nth-of-type(2) { animation-delay: 510ms; }
.campaign-card:nth-of-type(n+3) { animation-delay: 560ms; }

/* ---- Rentals: portfolio strip cells ---- */
.portfolio-strip .p {
  opacity: 0;
  animation: app-entry 280ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.portfolio-strip .p:nth-child(1) { animation-delay: 360ms; }
.portfolio-strip .p:nth-child(2) { animation-delay: 400ms; }
.portfolio-strip .p:nth-child(3) { animation-delay: 440ms; }
.portfolio-strip .p:nth-child(4) { animation-delay: 480ms; }

/* ---- Rentals: maintenance kanban cards cascade ---- */
.kanban-col details.expandable,
.kanban-col .maint {
  opacity: 0;
  animation: app-entry 320ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.kanban-col details.expandable:nth-of-type(1),
.kanban-col .maint:nth-of-type(1) { animation-delay: 440ms; }
.kanban-col details.expandable:nth-of-type(2),
.kanban-col .maint:nth-of-type(2) { animation-delay: 490ms; }
.kanban-col details.expandable:nth-of-type(3),
.kanban-col .maint:nth-of-type(3) { animation-delay: 540ms; }
.kanban-col details.expandable:nth-of-type(n+4),
.kanban-col .maint:nth-of-type(n+4) { animation-delay: 580ms; }

/* ---- Architecture: integration fabric grid cascade ---- */
.integration-grid .intg {
  opacity: 0;
  animation: app-entry 280ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.integration-grid .intg:nth-child(1) { animation-delay: 400ms; }
.integration-grid .intg:nth-child(2) { animation-delay: 430ms; }
.integration-grid .intg:nth-child(3) { animation-delay: 460ms; }
.integration-grid .intg:nth-child(4) { animation-delay: 490ms; }
.integration-grid .intg:nth-child(5) { animation-delay: 520ms; }
.integration-grid .intg:nth-child(6) { animation-delay: 550ms; }
.integration-grid .intg:nth-child(7) { animation-delay: 580ms; }
.integration-grid .intg:nth-child(8) { animation-delay: 610ms; }
.integration-grid .intg:nth-child(n+9) { animation-delay: 640ms; }

/* ---- Homepage integration pills ---- */
.intg-strip .intg-pill {
  opacity: 0;
  animation: app-entry 280ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.intg-strip .intg-pill:nth-child(1) { animation-delay: 540ms; }
.intg-strip .intg-pill:nth-child(2) { animation-delay: 570ms; }
.intg-strip .intg-pill:nth-child(3) { animation-delay: 600ms; }
.intg-strip .intg-pill:nth-child(4) { animation-delay: 630ms; }
.intg-strip .intg-pill:nth-child(5) { animation-delay: 660ms; }
.intg-strip .intg-pill:nth-child(6) { animation-delay: 690ms; }
.intg-strip .intg-pill:nth-child(n+7) { animation-delay: 720ms; }

/* ---- Architecture: model registry rows ---- */
.model-table .row {
  opacity: 0;
  animation: app-entry 280ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.model-table .row:nth-of-type(1) { animation-delay: 380ms; }
.model-table .row:nth-of-type(2) { animation-delay: 420ms; }
.model-table .row:nth-of-type(3) { animation-delay: 460ms; }
.model-table .row:nth-of-type(4) { animation-delay: 500ms; }
.model-table .row:nth-of-type(5) { animation-delay: 540ms; }

/* ---- Agent detail: page header + metric strip ---- */
.page-header {
  opacity: 0;
  animation: app-entry 320ms cubic-bezier(0.2, 0.7, 0.2, 1) 340ms both;
}
.metric-row .metric {
  opacity: 0;
  animation: app-entry 280ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.metric-row .metric:nth-child(1) { animation-delay: 420ms; }
.metric-row .metric:nth-child(2) { animation-delay: 460ms; }
.metric-row .metric:nth-child(3) { animation-delay: 500ms; }
.metric-row .metric:nth-child(4) { animation-delay: 540ms; }

/* ---- LIVE indicators get an outward radar ping ---- */
.badge.live .dot,
.section-meta .live-pill .d {
  position: relative;
}
.badge.live .dot::after,
.section-meta .live-pill .d::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--success);
  transform: translate(-50%, -50%);
  animation: radar-ping 2.4s cubic-bezier(0.2, 0.7, 0.2, 1) infinite;
  pointer-events: none;
}
@keyframes radar-ping {
  0%        { transform: translate(-50%, -50%) scale(1);   opacity: 0.55; }
  80%, 100% { transform: translate(-50%, -50%) scale(3.5); opacity: 0; }
}

/* ---- Hover-lift upgrade — more depth, smoother shadow ---- */
.kpi:hover,
.agent-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(15, 20, 30, 0.10);
}
.intg:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.kpi, .agent-card {
  /* keep the base transition smooth — slightly longer for the bigger lift */
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}

/* ---- Bottom nav: active-state bounce + indicator grow on nav-arrival ---- */
.bottom-nav a.active .nav-icon {
  animation: nav-icon-bounce 460ms cubic-bezier(0.2, 0.8, 0.2, 1) 340ms;
}
@keyframes nav-icon-bounce {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.18); }
  72%  { transform: scale(0.96); }
  100% { transform: scale(1); }
}
.bottom-nav a.active::before {
  animation: nav-indicator-in 420ms cubic-bezier(0.2, 0.8, 0.2, 1) 340ms both;
}
@keyframes nav-indicator-in {
  from { width: 0; opacity: 0; }
  to   { width: 28px; opacity: 1; }
}

/* ---- Approvals "Review" CTA — subtle periodic attention pulse ---- */
.approval-cta {
  animation: cta-pulse 6s cubic-bezier(0.2, 0.7, 0.2, 1) infinite;
}
@keyframes cta-pulse {
  0%, 80%, 100% { box-shadow: 0 0 0 0 rgba(184, 138, 43, 0); }
  88%           { box-shadow: 0 0 0 4px rgba(184, 138, 43, 0.30); }
  96%           { box-shadow: 0 0 0 14px rgba(184, 138, 43, 0); }
}

/* ---- KPI flash animations — slightly snappier easing ---- */
@keyframes kpi-flash-up {
  0%   { transform: scale(1);    color: var(--ink); }
  35%  { transform: scale(1.12); color: var(--success); }
  100% { transform: scale(1);    color: var(--ink); }
}
@keyframes kpi-flash-down {
  0%   { transform: scale(1);    color: var(--ink); }
  35%  { transform: scale(1.12); color: var(--warning); }
  100% { transform: scale(1);    color: var(--ink); }
}

/* ---- Feed: more pronounced arrival for new events ---- */
@keyframes feed-in {
  from { opacity: 0; transform: translateY(-12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- Status orbs (working/approval/urgent) get a smoother pulse ---- */
@keyframes pulse-dot {
  0%, 100% { opacity: 1;   box-shadow: 0 0 6px currentColor; }
  50%      { opacity: 0.35; box-shadow: 0 0 10px currentColor; }
}

/* ---- Honor reduced-motion preferences — strip decorative animations ---- */
@media (prefers-reduced-motion: reduce) {
  .kpi-row .kpi,
  .section-bar,
  .agent-grid .agent-card,
  .agent-list .row,
  .pipeline .pipe-stage,
  .list-row,
  .campaign-card,
  .kanban-col details.expandable,
  .kanban-col .maint,
  .integration-grid .intg,
  .intg-strip .intg-pill,
  .model-table .row,
  .page-header,
  .metric-row .metric,
  .portfolio-strip .p {
    animation: none !important;
    opacity: 1 !important;
  }
  .badge.live .dot::after,
  .section-meta .live-pill .d::after,
  .approval-cta,
  .bottom-nav a.active .nav-icon,
  .bottom-nav a.active::before {
    animation: none !important;
  }
}
