/* Nico — Pipeline dashboard (nico-outbound-dash.js). Tokens only; dark / light / sierra.
   Shared, identical in IOS/ and renderer/. */
.nod { --nod-c1: var(--accent); --nod-c2: var(--info); --nod-track: color-mix(in oklch, var(--text) 8%, transparent);
  font-family: var(--sans, -apple-system, system-ui, sans-serif); color: var(--text); container: nod / inline-size; display: flex; flex-direction: column; gap: 16px; margin: 4px 0 20px; }
.nod * { box-sizing: border-box; }
.nod-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.nod-head h2 { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: -0.02em; }
.nod-head p { margin: 0; font-size: 13px; color: var(--text-3); }
.nod-period { display: inline-flex; padding: 2px; border-radius: 10px; background: var(--surface-2); border: 0.5px solid var(--line); }
.nod-period button { appearance: none; border: 0; background: none; color: var(--text-2); font: 500 13px var(--sans, system-ui); padding: 0 12px; min-height: 36px; border-radius: 8px; cursor: pointer; position: relative; }
.nod-period button::after { content: ''; position: absolute; inset: -4px 0; }  /* 44pt hit area */
.nod-period button[aria-checked="true"] { background: var(--surface-1); color: var(--text); box-shadow: 0 1px 2px color-mix(in oklch, black 18%, transparent); font-weight: 600; }
.nod-period button:focus-visible, .nod-kpi:focus-visible, .nod-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* hero KPIs: horizontal rail on phones, grid when wider */
.nod-kpis { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(164px, 46%); gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 2px; scrollbar-width: none; }
.nod-kpis::-webkit-scrollbar { display: none; }
@container nod (min-width: 600px) { .nod-kpis { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; } }
@container nod (min-width: 1200px) { .nod-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.nod-kpi { appearance: none; text-align: left; scroll-snap-align: start; display: flex; flex-direction: column; gap: 4px; min-height: 112px; padding: 14px 14px 10px;
  background: var(--surface-1); border: 0.5px solid var(--line); border-radius: 14px; color: var(--text); cursor: pointer; font: inherit; position: relative; overflow: hidden;
  transition: border-color .15s ease, transform .15s ease; }
.nod-kpi:hover { border-color: var(--line-bright); }
.nod-kpi:active { transform: scale(0.99); }
.nod-kl { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.nod-kv { font-size: 24px; font-weight: 650; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.nod-ks { font-size: 12px; color: var(--text-3); display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.nod-kw { color: var(--text-4); }
.nod-kpi .nod-spark { position: absolute; right: 10px; bottom: 10px; width: 64px; height: 22px; opacity: 0.9; }
.nod-delta { font-size: 12px; font-weight: 600; letter-spacing: 0; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); }
.nod-delta.up { color: var(--ok); } .nod-delta.down { color: var(--err); }

/* cards */
.nod-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@container nod (min-width: 600px) { .nod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .nod-card.wide { grid-column: span 2; } }
@container nod (min-width: 1200px) { .nod-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .nod-card.wide { grid-column: span 2; } }
.nod-card { background: var(--surface-1); border: 0.5px solid var(--line); border-radius: 16px; padding: 16px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.nod-card header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.nod-card h3 { margin: 0; font-size: 15px; font-weight: 620; letter-spacing: -0.01em; }
.nod-card h4 { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--text-2); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.nod-sub { margin-top: 6px !important; }
.nod-meta { font-size: 12px; color: var(--text-3); }
.nod-na, .nod-hint { margin: 0; font-size: 12.5px; color: var(--text-3); line-height: 1.45; }
.nod-foot { font-size: 12.5px; color: var(--text-3); border-top: 0.5px solid var(--line); padding-top: 10px; }
.nod-pill { font-size: 11.5px; font-weight: 500; color: var(--text-3); background: var(--surface-2); padding: 2px 7px; border-radius: 999px; }
.nod-stats3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.nod-stats3 > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nod-stats3 .v { font-size: 19px; font-weight: 640; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.nod-stats3 .l { font-size: 12px; color: var(--text-3); line-height: 1.35; }
.nod-chan { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
@container nod (min-width: 600px) { .nod-chan { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* bars + funnel */
.nod-bars, .nod-funnel { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.nod-bar, .nod-funnel li { display: grid; grid-template-columns: minmax(112px, 32%) minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 13px; }
.nod-bar-l, .nod-fl { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nod-bar-t, .nod-ft { height: 8px; border-radius: 999px; background: var(--nod-track); overflow: hidden; }
.nod-bar-t i, .nod-ft i { display: block; height: 100%; border-radius: 999px; background: var(--nod-c1); transition: width .5s cubic-bezier(.2,.8,.2,1); }
.nod-funnel .nod-ft i { background: var(--nod-c2); }
.nod-bar-v, .nod-fv { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; white-space: nowrap; }
.nod-bar-v small, .nod-fv small { display: block; font-weight: 400; font-size: 11.5px; color: var(--text-3); }
.nod-dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.nod-dl dt { font-size: 12px; color: var(--text-3); }
.nod-dl dd { margin: 2px 0 0; font-size: 18px; font-weight: 640; font-variant-numeric: tabular-nums; }
.nod-dl dd small { font-size: 12px; font-weight: 400; color: var(--text-3); margin-left: 6px; }
.nod-trend { display: flex; align-items: center; gap: 10px; }
.nod-trend .nod-spark { width: 120px; height: 32px; flex: none; }
.nod-spark .line { fill: none; stroke: var(--nod-c1); stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.nod-spark .area { fill: color-mix(in oklch, var(--nod-c1) 14%, transparent); stroke: none; }

.nod-btn { appearance: none; border: 0.5px solid var(--line-bright); background: var(--surface-2); color: var(--text); border-radius: 10px; min-height: 44px; padding: 0 16px; font: 600 14px var(--sans, system-ui); cursor: pointer; align-self: flex-start; }
.nod-btn.primary { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.nod-empty { background: var(--surface-1); border: 0.5px solid var(--line); border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 8px; }
.nod-empty h3 { margin: 0; font-size: 16px; } .nod-empty p { margin: 0 0 6px; color: var(--text-3); font-size: 13.5px; }

/* skeleton */
.nod-kpi.sk, .nod-card.sk { min-height: 112px; cursor: default; background: linear-gradient(90deg, var(--surface-1) 0%, var(--surface-2) 50%, var(--surface-1) 100%); background-size: 200% 100%; animation: nod-shimmer 1.4s ease-in-out infinite; }
.nod-card.sk { min-height: 180px; }
@keyframes nod-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.nod.still *, .nod.still *::before { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { .nod * { animation: none !important; transition: none !important; } }
@container nod (max-width: 360px) { .nod-kv { font-size: 21px; } .nod-stats3 { grid-template-columns: minmax(0,1fr) minmax(0,1fr); } .nod-bar, .nod-funnel li { grid-template-columns: minmax(70px, 34%) minmax(0,1fr) auto; } }

/* hosts: the iPad content pane has no gutter of its own above .ip-pipe */
.ip-content > [data-nod-host] { padding: 18px 24px 4px; }
#pane-pipeline [data-nod-host] { padding: 12px 20px 8px; }
