/* ── AUTOMATION TAB ───────────────────────────────────────────────────────── */

.auto-empty{
  text-align:center;
  padding:48px 20px;
  color:var(--text3);
  font-size:13px;
}

/* ── OPS STATUS PANEL ────────────────────────────────────────────────────── */

.aop-wrap{
  margin-top:16px;
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  background:var(--surface);
  box-shadow:var(--shadow);
  padding:14px 16px 12px;
  transition:box-shadow 0.2s,border-color 0.2s;
}
.aop-wrap:hover{
  box-shadow:var(--shadow-lg);
  border-color:var(--border2);
}
.aop-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:12px;
}
.aop-title{
  font-size:11px;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:0.06em;
  color:var(--text3);
}
.aop-refreshed{
  font-size:10px;
  color:var(--text3);
  opacity:0.6;
}
.aop-cards{
  display:flex;
  gap:0;
}
.aop-card{
  flex:1;
  min-width:0;
  padding:0 16px;
  border-left:1px solid var(--border);
}
.aop-card:first-child{
  padding-left:0;
  border-left:none;
}
.aop-card-label{
  font-size:10px;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:0.05em;
  color:var(--text3);
  margin-bottom:6px;
  white-space:nowrap;
}
.aop-card-sub{
  font-size:10px;
  color:var(--text3);
  margin-top:2px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* Scheduler state */
.aop-state{
  display:flex;
  align-items:center;
  gap:6px;
}
.aop-dot{
  width:8px;
  height:8px;
  border-radius:50%;
  flex-shrink:0;
  transition:box-shadow 0.3s;
}
.aop-state-name{
  font-size:13px;
  font-weight:600;
  color:var(--text);
}

/* Run cards */
.aop-run-time{
  font-size:13px;
  font-weight:600;
  color:var(--text);
  white-space:nowrap;
}
.aop-run-meta{
  display:flex;
  align-items:center;
  gap:4px;
  margin-top:3px;
  font-size:10px;
  color:var(--text3);
  white-space:nowrap;
}
.aop-run-dot{
  width:6px;
  height:6px;
  border-radius:50%;
  flex-shrink:0;
}
.aop-run-status{
  text-transform:capitalize;
}
.aop-run-sep{
  color:var(--border);
}
.aop-never{
  color:var(--text3);
  font-weight:400;
  font-size:12px;
}

/* Freshness card */
.aop-freshness-list{
  display:flex;
  flex-direction:column;
  gap:4px;
}
.aop-freshness-row{
  display:flex;
  align-items:center;
  gap:5px;
  font-size:11px;
  color:var(--text2);
}
.aop-freshness-dot{
  width:6px;
  height:6px;
  border-radius:50%;
  flex-shrink:0;
}
.aop-freshness-age{
  font-size:10px;
  color:var(--text3);
}

/* Failures banner */
.aop-failures{
  display:flex;
  align-items:center;
  gap:6px;
  margin-top:10px;
  padding:6px 10px;
  border-radius:8px;
  background:rgba(var(--red-ch),0.08);
  color:var(--red);
  font-size:11px;
  font-weight:500;
}

/* Loading skeleton */
/* S9: shimmer unified onto the shared .skeleton-line (components.css) —
   this class keeps only the block geometry. */
.aop-loading{
  height:90px;
  margin-top:16px;
  border-radius:var(--radius-lg);
  border:1px solid var(--border);
}

/* ── ACTIVITY PULSE ──────────────────────────────────────────────────────── */

.apulse-wrap{
  position:relative;
  /* The entrance stagger (card-in, forwards-filled at translateY(0)) leaves a
     transform on every panel, so each becomes its own stacking context painted
     in DOM order. Without a positive z-index here, the downward-opening hover
     tooltip is trapped inside this panel's context and the later sibling panels
     (cadence pills, portfolio list) paint over it. */
  z-index:1;
  margin-top:16px;
  padding:18px 20px 8px;
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  background:var(--surface);
  box-shadow:var(--shadow);
  transition:box-shadow 0.2s,border-color 0.2s;
}
.apulse-wrap:hover{
  box-shadow:var(--shadow-lg);
  border-color:var(--border2);
}

.apulse-header{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:24px;
  margin-bottom:14px;
}
.apulse-title{
  font-family:var(--font-display, var(--font-ui));
  font-size:18px;
  font-weight:600;
  letter-spacing:-0.015em;
  color:var(--text);
}
.apulse-summary{
  display:inline-flex;
  align-items:baseline;
  gap:5px;
  font-size:11px;
  color:var(--text3);
  font-variant-numeric:tabular-nums;
}
.apulse-summary-num{
  font-size:14px;
  font-weight:600;
  color:var(--text);
  letter-spacing:-0.01em;
}
.apulse-summary-sep{
  color:var(--text3);
}

.apulse-ribbon{
  position:relative;
  width:100%;
}
.apulse-svg{
  width:100%;
  height:84px;
  display:block;
  overflow:visible;
}

.apulse-track-bg{
  fill:color-mix(in srgb, var(--accent) 6%, var(--surface2));
  rx:3;
  stroke:var(--border);
  stroke-width:1;
}
.apulse-grid-line{
  stroke:var(--border2);
  stroke-width:1;
  stroke-dasharray:2 3;
  opacity:0.55;
}
.apulse-tick{
  fill:color-mix(in srgb, var(--accent) 55%, var(--surface2));
  transition:fill 0.15s;
}
.apulse-tick-nightly{
  fill:var(--accent);
}
.apulse-tick-cap{
  fill:var(--accent);
}
.apulse-tick-hover{
  fill:var(--accent) !important;
}

.apulse-now-line{
  stroke:var(--text);
  stroke-width:1;
  opacity:0.35;
}
.apulse-now-dot{
  fill:var(--text);
  opacity:0.75;
}

.apulse-hover-layer{
  position:absolute;
  inset:22px 0 22px 0;
  pointer-events:none;
}
.apulse-hover-hit{
  position:absolute;
  top:-12px;
  bottom:-12px;
  width:20px;
  margin-left:-10px;
  background:transparent;
  border:none;
  cursor:pointer;
  pointer-events:auto;
  padding:0;
}
.apulse-hover-hit:focus-visible{
  outline:2px solid var(--accent);
  outline-offset:2px;
  border-radius:4px;
}

.apulse-axis{
  position:relative;
  height:16px;
  margin-top:2px;
}
.apulse-axis-label{
  position:absolute;
  top:0;
  transform:translateX(-50%);
  font-family:var(--font-mono, var(--font-ui));
  font-size:9px;
  font-variant-numeric:tabular-nums;
  color:var(--text3);
  letter-spacing:0.04em;
  white-space:nowrap;
}
.apulse-axis-label:first-child{
  transform:translateX(0);
}
.apulse-axis-label:last-child{
  transform:translateX(-100%);
}
.apulse-axis-now{
  color:var(--text);
  font-weight:600;
  text-transform:uppercase;
}

.apulse-tooltip{
  position:absolute;
  top:calc(100% + 10px);
  transform:translateX(-50%);
  background:var(--surface);
  border:1px solid var(--border2);
  border-radius:var(--radius);
  box-shadow:var(--shadow-lg);
  padding:10px 12px;
  min-width:180px;
  max-width:240px;
  z-index:10;
  pointer-events:none;
  animation:apulseTooltipIn calc(var(--motion-fast)*0.8) ease-out;
}
.apulse-tooltip::before{
  content:'';
  position:absolute;
  top:-5px;
  left:50%;
  transform:translateX(-50%) rotate(45deg);
  width:9px;
  height:9px;
  background:var(--surface);
  border-top:1px solid var(--border2);
  border-left:1px solid var(--border2);
}
@keyframes apulseTooltipIn{
  from{opacity:0;transform:translate(-50%, -4px)}
  to{opacity:1;transform:translate(-50%, 0)}
}
.apulse-tooltip-time{
  font-size:11px;
  font-weight:600;
  color:var(--text);
  font-variant-numeric:tabular-nums;
  letter-spacing:-0.01em;
}
.apulse-tooltip-count{
  font-size:10px;
  color:var(--text3);
  margin-top:2px;
  margin-bottom:8px;
}
.apulse-tooltip-nightly{
  color:var(--accent);
  font-weight:500;
}
.apulse-tooltip-list{
  display:flex;
  flex-direction:column;
  gap:4px;
}
.apulse-tooltip-row{
  display:flex;
  align-items:center;
  gap:7px;
  font-size:11px;
  color:var(--text2);
  white-space:nowrap;
  overflow:hidden;
}
.apulse-tooltip-dot{
  width:5px;
  height:5px;
  border-radius:50%;
  flex-shrink:0;
}
.apulse-tooltip-dot-nightly{background:var(--accent)}
.apulse-tooltip-dot-intraday{background:color-mix(in srgb, var(--accent) 55%, var(--surface3))}
.apulse-tooltip-name{
  overflow:hidden;
  text-overflow:ellipsis;
}
.apulse-tooltip-more{
  font-size:10px;
  color:var(--text3);
  margin-top:4px;
  font-style:italic;
}

/* ── CADENCE PILLS ───────────────────────────────────────────────────────── */

.cpill-wrap{
  margin-top:16px;
}
.cpill-label-row{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  margin-bottom:8px;
  padding:0 2px;
}
.cpill-label{
  font-size:10px;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:0.06em;
  color:var(--text3);
}
.cpill-hint{
  font-size:10px;
  color:var(--text3);
  font-style:italic;
  opacity:0.8;
}

.cpill-row{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(140px, 1fr));
  gap:8px;
}

.cpill{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:2px;
  padding:12px 14px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  cursor:pointer;
  transition:border-color 0.18s, background 0.18s, transform 0.18s, box-shadow 0.18s;
  text-align:left;
  font-family:inherit;
  color:inherit;
  position:relative;
  overflow:hidden;
}
.cpill:hover{
  border-color:var(--border2);
  background:var(--surface);
  box-shadow:var(--shadow);
}
.cpill::before{
  content:'';
  position:absolute;
  top:0;
  right:0;
  bottom:0;
  width:3px;
  background:currentColor;
  opacity:0;
  transition:opacity 0.18s;
}

.cpill-count{
  font-family:var(--font-display, var(--font-ui));
  font-size:28px;
  font-weight:600;
  line-height:1;
  letter-spacing:-0.03em;
  color:var(--text);
  font-variant-numeric:tabular-nums;
  margin-bottom:4px;
}
.cpill-name{
  font-size:12px;
  font-weight:600;
  color:var(--text);
  letter-spacing:-0.005em;
}
.cpill-detail{
  font-size:10px;
  color:var(--text3);
  letter-spacing:0.01em;
}

/* Pill active state — accent-filled */
.cpill-active{
  border-color:var(--accent);
  background:color-mix(in srgb, var(--accent) 10%, var(--surface));
  box-shadow:0 0 0 1px var(--accent), var(--shadow-lg);
  transform:translateY(-1px);
}
.cpill-active .cpill-count{color:var(--accent)}
.cpill-active::before{opacity:1}

/* Empty pills (count=0) dim a bit */
.cpill-empty{
  opacity:0.55;
}
.cpill-empty:hover{
  opacity:1;
}

/* Per-cadence color hint (subtle) on the count number */
.cpill-off .cpill-count{color:var(--text2)}
.cpill-nightly.cpill-active .cpill-count{color:var(--accent)}
.cpill-moderate.cpill-active .cpill-count{color:var(--accent)}
.cpill-aggressive.cpill-active .cpill-count{color:var(--accent)}
.cpill-custom .cpill-count{color:var(--amber)}
.cpill-custom.cpill-active{
  border-color:var(--amber);
  background:color-mix(in srgb, var(--amber) 8%, var(--surface));
}
.cpill-custom.cpill-active .cpill-count{color:var(--amber)}

.cpill-all{
  background:color-mix(in srgb, var(--accent) 3%, var(--surface));
}
.cpill-all.cpill-active{
  background:color-mix(in srgb, var(--accent) 10%, var(--surface));
  border-color:var(--accent);
}
.cpill-all.cpill-active .cpill-count{color:var(--accent)}

/* ── CADENCE SEGMENTED CONTROL (in row) ───────────────────────────────────────── */

.aseg{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:4px;
  min-width:0;
}
.aseg-track{
  display:inline-flex;
  align-items:center;
  padding:2px;
  background:var(--surface2);
  border:1px solid var(--border);
  border-radius:999px;
}
.aseg-btn{
  appearance:none;
  border:none;
  background:transparent;
  font-family:inherit;
  font-size:11px;
  font-weight:500;
  color:var(--text3);
  padding:4px 11px;
  border-radius:999px;
  cursor:pointer;
  white-space:nowrap;
  letter-spacing:-0.005em;
  transition:background 0.15s, color 0.15s, box-shadow 0.15s;
}
.aseg-btn:hover:not(.aseg-btn-active):not(:disabled){
  color:var(--text);
}
.aseg-btn:disabled{
  opacity:0.45;
  cursor:not-allowed;
}
.aseg-btn-active{
  background:var(--surface);
  color:var(--text);
  box-shadow:var(--shadow-sm, 0 1px 2px rgba(0,0,0,0.12));
}
.aseg-btn-nightly.aseg-btn-active{
  box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, var(--border)), var(--shadow-sm, 0 1px 2px rgba(0,0,0,0.12));
}
.aseg-btn-moderate.aseg-btn-active{
  background:color-mix(in srgb, var(--accent) 12%, var(--surface));
  color:var(--accent);
  box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent);
}
.aseg-btn-aggressive.aseg-btn-active{
  background:var(--accent);
  color:#fff;
  box-shadow:0 1px 3px color-mix(in srgb, var(--accent) 40%, transparent);
}
/* Plain text below the segmented selector (not an inline pill — the pill's
   width overflowed the Cadence column into Nightly when many rows are Custom). */
.aseg-custom{
  font-size:9.5px;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:0.06em;
  color:var(--amber);
  white-space:nowrap;
  padding-left:3px;
}

/* ── AUTOMATION ROW LIST ─────────────────────────────────────────────────── */

.arow-list-card{
  margin-top:16px;
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  background:var(--surface);
  box-shadow:var(--shadow);
  overflow:hidden;
  transition:box-shadow 0.2s, border-color 0.2s;
}
.arow-list-card:hover{
  box-shadow:var(--shadow-lg);
  border-color:var(--border2);
}

.arow-list-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:14px 16px;
  border-bottom:1px solid var(--border);
}
.arow-list-title{
  display:flex;
  align-items:baseline;
  gap:10px;
  font-family:var(--font-display, var(--font-ui));
  font-size:14px;
  font-weight:600;
  letter-spacing:-0.01em;
  color:var(--text);
}
.arow-list-count{
  font-size:11px;
  font-weight:500;
  color:var(--text3);
  font-family:var(--font-ui);
  font-variant-numeric:tabular-nums;
}

.arow-list-search{
  position:relative;
  display:flex;
  align-items:center;
  gap:6px;
  padding:0 10px;
  background:var(--surface2);
  border:1px solid var(--border);
  border-radius:999px;
  min-width:220px;
  transition:border-color 0.15s;
}
.arow-list-search:focus-within{
  border-color:var(--accent);
}
.arow-list-search svg{
  color:var(--text3);
  flex-shrink:0;
}
.arow-list-search-input{
  flex:1;
  background:transparent;
  border:none;
  outline:none;
  padding:6px 0;
  font-family:inherit;
  font-size:12px;
  color:var(--text);
}
.arow-list-search-input::placeholder{
  color:var(--text3);
}
.arow-list-search-clear{
  background:none;
  border:none;
  color:var(--text3);
  cursor:pointer;
  font-size:14px;
  padding:0 4px;
  line-height:1;
}
.arow-list-search-clear:hover{color:var(--text)}

.arow-list-col-labels{
  display:grid;
  grid-template-columns:minmax(210px,250px) minmax(0,1fr) 132px 96px;
  gap:16px;
  padding:6px 16px;
  font-size:10px;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:0.06em;
  color:var(--text3);
  background:color-mix(in srgb, var(--accent) 2%, var(--surface2));
  border-bottom:1px solid var(--border);
}

/* Section labels for the controls area live here in the header (not repeated
   per row). The track template MUST match .arow-ctlbox so each label sits over
   its section. */
.arow-list-col-controls{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1.1fr);
  column-gap:28px;
  min-width:0;
}

.arow-list-col{
  display:inline-flex;
  align-items:center;
  gap:6px;
  text-align:left;
  font:inherit;
  color:inherit;
  letter-spacing:inherit;
  text-transform:inherit;
}

.arow-list-col-sortable{
  background:none;
  border:none;
  padding:4px 6px;
  margin:-4px -6px;
  border-radius:6px;
  cursor:pointer;
  transition:background 0.15s, color 0.15s;
}
.arow-list-col-sortable:hover{
  background:color-mix(in srgb, var(--accent) 6%, transparent);
  color:var(--text2);
}
.arow-list-col-sortable:focus-visible{
  outline:2px solid var(--accent);
  outline-offset:1px;
}
.arow-list-col-active{
  color:var(--text);
}

.arow-list-col-sort-icon{
  font-size:11px;
  opacity:0.35;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:10px;
  font-weight:500;
  transition:opacity 0.15s, color 0.15s;
}
.arow-list-col-active .arow-list-col-sort-icon{
  opacity:1;
  color:var(--accent);
}
.arow-list-col-sortable:hover .arow-list-col-sort-icon{
  opacity:0.7;
}

.arow-list{
  display:flex;
  flex-direction:column;
}
.arow-list-empty{
  padding:36px 16px;
  text-align:center;
  font-size:12.5px;
  color:var(--text3);
}

.arow{
  display:grid;
  grid-template-columns:minmax(210px,250px) minmax(0,1fr) 132px 96px;
  gap:16px;
  align-items:center;
  padding:14px 16px;
  border-bottom:1px solid var(--border2);
  transition:background 0.12s;
  position:relative;
}
.arow:not(.motion-entered){
  opacity:0;transform:translateY(12px);
  animation:card-in var(--motion-slow) var(--ease-out) forwards;
}
.arow:last-child{border-bottom:none}
.arow:hover{
  background:color-mix(in srgb, var(--accent) 3%, transparent);
}
.arow-dimmed .arow-name{color:var(--text2)}
.arow-dimmed:hover .arow-name{color:var(--text)}

/* ── PORTFOLIO COLUMN ─────────────────────────────────────────────────────── */

.arow-pf{
  display:flex;
  flex-direction:column;
  gap:3px;
  min-width:0;
}
.arow-pf-head{
  display:flex;
  align-items:center;
  gap:6px;
  min-width:0;
}
.arow-name{
  font-size:13px;
  font-weight:600;
  color:var(--text);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  letter-spacing:-0.005em;
  min-width:0;
}
.arow-pf-sub{
  font-size:11px;
  color:var(--text3);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  letter-spacing:-0.005em;
}

/* ── KEBAB MENU ───────────────────────────────────────────────────────────── */

.arow-kebab{
  flex-shrink:0;
  width:24px;
  height:24px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:none;
  border:none;
  border-radius:6px;
  color:var(--text3);
  cursor:pointer;
  opacity:0;
  transition:background 0.12s, color 0.12s, opacity 0.12s;
}
.arow:hover .arow-kebab,
.arow-kebab-open{opacity:1}
.arow-kebab:hover,
.arow-kebab-open{
  background:var(--surface2);
  color:var(--text);
}
.arow-kebab-menu{min-width:184px}
.arow-kebab-danger{color:var(--red)}
.arow-kebab-danger:hover:not(:disabled){
  background:color-mix(in srgb, var(--red) 10%, transparent);
  color:var(--red);
}
.arow-kebab-danger:disabled{
  opacity:0.4;
  cursor:not-allowed;
}

/* ── AUTOMATION CONTROLS BOX ──────────────────────────────────────────────── */

.arow-ctlbox{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1.1fr);
  column-gap:28px;
  align-items:stretch;
  min-width:0;
}
.arow-sec{
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:7px;
  min-width:0;
  position:relative;
}
/* Thin vertical divider between sections, inset so it doesn't reach the row
   top/bottom. Sits in the middle of the 28px column gap. */
.arow-sec + .arow-sec::before{
  content:'';
  position:absolute;
  left:-14px;
  top:6px;
  bottom:6px;
  width:1px;
  background:var(--border);
}
/* Section labels live in the table header on wide screens (no per-row
   duplication); they reappear inside each row only when controls stack. */
.arow-sec-label{
  display:none;
  font-size:9.5px;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:0.07em;
  color:var(--text3);
}
.arow-sec-body{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:24px;
}
.arow-sec-body-stack{
  flex-direction:column;
  align-items:flex-start;
  gap:8px;
}
.arow-sec-line{
  display:flex;
  align-items:center;
  gap:8px;
}
.arow-sec-body-dim .arow-field,
.arow-sec-body-dim .arow-check,
.arow-sec-body-dim .arow-select,
.arow-sec-body-dim .arow-sep{
  opacity:0.55;
}

/* ── NEXT RUN (two-line) ──────────────────────────────────────────────────── */

.arow-next{
  display:flex;
  flex-direction:column;
  gap:1px;
  font-family:var(--font-ui);
  font-variant-numeric:tabular-nums;
  letter-spacing:-0.005em;
}
.arow-next-rel{
  font-size:12px;
  font-weight:500;
  color:var(--text);
}
.arow-next-rel.arow-next-off{color:var(--text3); font-weight:400}
.arow-next-abs{
  font-size:10.5px;
  color:var(--text3);
}

.arow-status{
  display:inline-flex;
  align-items:center;
  gap:7px;
  font-size:11.5px;
  color:var(--text2);
  letter-spacing:-0.005em;
}
.arow-bead{
  width:7px;
  height:7px;
  border-radius:50%;
  flex-shrink:0;
  position:relative;
}
.arow-bead-ok{
  background:var(--green);
  box-shadow:0 0 0 3px color-mix(in srgb, var(--green) 18%, transparent);
}
.arow-bead-fail{
  background:var(--red);
  box-shadow:0 0 0 3px color-mix(in srgb, var(--red) 18%, transparent);
}
.arow-bead-off{
  background:transparent;
  border:1px solid var(--text3);
  width:6px;
  height:6px;
}
.arow-bead-pending{
  background:var(--text3);
  opacity:0.55;
}

/* ── ROW INLINE CONTROL PRIMITIVES ───────────────────────────────────────── */

.arow-switch{
  position:relative;
  display:inline-flex;
  align-items:center;
  gap:8px;
  cursor:pointer;
  user-select:none;
}
.arow-switch input{
  position:absolute;
  opacity:0;
  width:0;
  height:0;
}
.arow-switch-track{
  position:relative;
  width:32px;
  height:18px;
  background:var(--surface3);
  border:1px solid var(--border);
  border-radius:999px;
  transition:background 0.16s, border-color 0.16s;
}
.arow-switch-thumb{
  position:absolute;
  top:1px;
  left:1px;
  width:14px;
  height:14px;
  background:var(--text3);
  border-radius:50%;
  /* §34 toggle station — knob family spring: the lab-approved 0.38s hard
     overshoot (calc(base*1.5) = 0.375s ≈ the signed-off 0.38s) */
  transition:transform calc(var(--motion-base)*1.5) var(--ease-spring-hard), background 0.18s;
}
.arow-switch-on .arow-switch-track{
  background:var(--accent);
  border-color:var(--accent);
}
.arow-switch-on .arow-switch-thumb{
  transform:translateX(14px);
  background:#fff;
}
.arow-switch-disabled{
  opacity:0.4;
  pointer-events:none;
}

.arow-time{
  font-family:var(--font-ui);
  font-variant-numeric:tabular-nums;
  font-size:12px;
  padding:4px 8px;
  background:var(--surface2);
  border:1px solid var(--border);
  border-radius:8px;
  color:var(--text);
  outline:none;
  transition:border-color 0.15s;
}
.arow-time:focus{border-color:var(--accent)}
.arow-time:disabled{opacity:0.4;cursor:not-allowed}

.arow-field{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:11.5px;
  color:var(--text2);
}
.arow-field-label{
  color:var(--text3);
  text-transform:uppercase;
  letter-spacing:0.06em;
  font-size:10px;
  font-weight:600;
}

.arow-select{
  font-family:var(--font-ui);
  font-variant-numeric:tabular-nums;
  font-size:12px;
  padding:4px 8px;
  background:var(--surface2);
  border:1px solid var(--border);
  border-radius:8px;
  color:var(--text);
  cursor:pointer;
  outline:none;
  transition:border-color 0.15s;
}
.arow-select:focus{border-color:var(--accent)}
.arow-select:disabled{opacity:0.4;cursor:not-allowed}

.arow-sep{
  color:var(--text3);
  font-size:11px;
}

.arow-check{
  display:inline-flex;
  align-items:center;
  gap:7px;
  font-size:11.5px;
  color:var(--text2);
  cursor:pointer;
}
.arow-check input{
  appearance:none;
  -webkit-appearance:none;
  width:15px;
  height:15px;
  margin:0;
  flex-shrink:0;
  position:relative;
  border:1px solid var(--border2);
  border-radius:4px;
  background:var(--surface);
  cursor:pointer;
  transition:background 0.12s, border-color 0.12s;
}
.arow-check input:checked{
  background:var(--accent);
  border-color:var(--accent);
}
.arow-check input:checked::after{
  content:'';
  position:absolute;
  left:5px;
  top:2px;
  width:3.5px;
  height:7.5px;
  border:solid #fff;
  border-width:0 2px 2px 0;
  transform:rotate(45deg);
}
.arow-check input:disabled{cursor:not-allowed}
.arow-check-disabled{
  opacity:0.4;
  cursor:not-allowed;
}
.arow-check-disabled input{cursor:not-allowed}

/* ── SCHEDULER RUNS LOG ──────────────────────────────────────────────────── */

.auto-runs-toggle{
  margin-top:24px;
  font-size:12px;
  color:var(--accent);
  cursor:pointer;
  user-select:none;
  display:inline-flex;
  align-items:center;
  gap:4px;
}
.auto-runs-toggle:hover{
  color:color-mix(in srgb, var(--accent) 80%, var(--text));
}
.auto-runs-chevron{
  display:inline-block;
  transition:transform 0.2s ease;
  font-size:10px;
}
.auto-runs-toggle.open .auto-runs-chevron{
  transform:rotate(90deg);
}

.auto-runs-wrap{
  margin-top:12px;
}
.auto-runs-table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  font-size:12px;
}
.auto-runs-table th{
  text-align:left;
  padding:6px 10px;
  font-size:10px;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:0.06em;
  color:var(--text3);
  border-bottom:1px solid var(--border);
}
.auto-runs-table td{
  padding:6px 10px;
  border-bottom:1px solid var(--border2);
  font-size:11px;
}
.auto-runs-table tr:hover td{
  background:var(--surface);
}

/* Status badges for runs log */
.auto-run-badge{
  display:inline-block;
  padding:1px 7px;
  border-radius:8px;
  font-size:10px;
  font-weight:600;
  letter-spacing:0.02em;
}
.auto-run-badge.completed{background:rgba(var(--green-ch),0.15);color:var(--green)}
.auto-run-badge.partial{background:rgba(var(--amber-ch),0.15);color:var(--amber)}
.auto-run-badge.failed{background:rgba(var(--red-ch),0.15);color:var(--red)}
.auto-run-badge.running{background:rgba(var(--accent-ch),0.15);color:var(--accent)}

/* ── Automation paused banner ─────────────────────────────────────────── */
.automation-paused-banner {
  display:flex; align-items:flex-start; gap:14px;
  padding:14px 18px; margin:0 0 16px 0;
  background:color-mix(in srgb, var(--red) 10%, transparent);
  border:1px solid color-mix(in srgb, var(--red) 35%, transparent);
  border-radius:var(--radius-lg);
  color:var(--text);
}
.apb-icon { color:var(--red); flex-shrink:0; margin-top:2px; }
.apb-text { flex:1; min-width:0; }
.apb-title { font-weight:600; font-size:14px; margin-bottom:2px; color:var(--red); }
.apb-body { font-size:12.5px; color:var(--text2); line-height:1.45; }
.apb-cta { flex-shrink:0; align-self:center; }

/* ── Paused pane (Automation tab) ────────────────────────────────────── */
.aut-paused-pane {
  display:flex; flex-direction:column; gap:14px;
  padding:20px 22px; margin:0 0 18px 0;
  background:var(--bg2);
  border:1px solid color-mix(in srgb, var(--red) 30%, var(--border));
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow);
}
.aut-paused-pane.is-auto { border-color:color-mix(in srgb, var(--amber) 40%, var(--border)); }
.aut-paused-header { display:flex; align-items:center; gap:10px; }
.aut-paused-title { font-weight:600; font-size:15px; }
.aut-paused-badge {
  font-size:10.5px; font-weight:600; text-transform:uppercase; letter-spacing:0.5px;
  padding:3px 8px; border-radius:999px;
  background:color-mix(in srgb, var(--red) 18%, transparent);
  color:var(--red);
}
.aut-paused-pane.is-auto .aut-paused-badge {
  background:color-mix(in srgb, var(--amber) 18%, transparent);
  color:var(--amber);
}
.aut-paused-meta { font-size:12px; color:var(--text3); }
.aut-paused-list { font-size:12.5px; color:var(--text2); line-height:1.5; }
.aut-paused-list strong { color:var(--text); }
.aut-paused-actions { display:flex; gap:10px; margin-top:6px; }

/* Resume confirmation modal */
.aut-resume-modal { max-width:480px; }
.aut-resume-modal label {
  display:flex; align-items:flex-start; gap:10px;
  padding:12px; margin:14px 0;
  background:var(--bg);
  border:1px solid var(--border);
  border-radius:var(--radius);
  font-size:13px; cursor:pointer;
}
.aut-resume-modal label input { margin-top:2px; }

/* ── Responsive tweaks ───────────────────────────────────────────────── */
/* ── ENTRANCE STAGGER (first mount of the Automation panel) ───────────────── */
/* Reuses the global `card-in` keyframe. Top blocks rise + fade in sequence;
   the list card fades (no rise, so it doesn't compound with the row motion);
   each row rises with an index-based delay set inline by AutomationRow. */
.aop-wrap:not(.motion-entered),
.apulse-wrap:not(.motion-entered),
.cpill-wrap:not(.motion-entered){
  opacity:0;
  transform:translateY(12px);
  animation:card-in var(--motion-slow) var(--ease-out) forwards;
}
.aop-wrap{animation-delay:0.04s}
.apulse-wrap{animation-delay:0.10s}
.cpill-wrap{animation-delay:0.16s}
.arow-list-card:not(.motion-entered){
  opacity:0;
  animation:card-in var(--motion-slow) var(--ease-out) 0.20s forwards;
}

@media (max-width: 1480px) {
  /* Not enough room for three control columns beside the other columns — stack
     them vertically and bring the per-row section labels back. The header
     control labels no longer line up, so hide them — but keep the grid cell
     occupied (visibility, NOT display:none) so Next run / Status stay in
     tracks 3 / 4 and don't shift left over the wrong columns. */
  .arow-list-col-controls{visibility:hidden}
  .arow-ctlbox{
    grid-template-columns:1fr;
    row-gap:10px;
    align-items:start;
  }
  .arow-sec{justify-content:flex-start}
  .arow-sec + .arow-sec::before{display:none}
  .arow-sec-label{display:block}
}
@media (max-width: 1024px) {
  .arow-list-col-labels,
  .arow{
    grid-template-columns:minmax(180px,220px) minmax(0,1fr) 112px 84px;
    gap:12px;
  }
}
@media (max-width: 860px) {
  /* Stack: portfolio + status on top, controls box full width, next run below. */
  .arow{
    grid-template-columns:1fr auto;
    grid-template-areas:
      "pf status"
      "ctl ctl"
      "next next";
    gap:10px 12px;
    align-items:start;
  }
  .arow-pf{grid-area:pf}
  .arow-status{grid-area:status}
  .arow-ctlbox{grid-area:ctl}
  .arow-next{
    grid-area:next;
    flex-direction:row;
    gap:8px;
    align-items:baseline;
  }
  .arow-list-col-labels{display:none}
}

/* ── Motion S9 sweep: reduced-motion guards (file previously had none) ── */
@media (prefers-reduced-motion:reduce){
  .arow:not(.motion-entered),.aop-wrap:not(.motion-entered),
  .apulse-wrap:not(.motion-entered),.cpill-wrap:not(.motion-entered),
  .arow-list-card:not(.motion-entered){animation-duration:0.01ms}
  .apulse-tooltip{animation:none}
}
