/* Palm Eye Cloud portal — traceability visuals (viz.js) and the trace / explorer / learn / missing / live / analytics
 * page layouts. Colour stays semantic: answered green · refused orange · silent (NO DATA) yellow · bus red · adapter
 * purple; data pins accent, power pins blue. Copyright © 2026 Palm Digitalz. All rights reserved. */

:root { --c-ok: var(--green); --c-refused: var(--orange); --c-silent: var(--yellow); --c-bus: var(--red); --c-adapter: var(--purple); }

/* ---------- outcome swatches / pills ---------- */
.tl-ok { fill: var(--c-ok); } .tl-refused { fill: var(--c-refused); } .tl-silent { fill: var(--c-silent); } .tl-bus { fill: var(--c-bus); } .tl-adapter { fill: var(--c-adapter); }
.tl-sw-ok { background: var(--c-ok); } .tl-sw-refused { background: var(--c-refused); } .tl-sw-silent { background: var(--c-silent); } .tl-sw-bus { background: var(--c-bus); } .tl-sw-adapter { background: var(--c-adapter); }
.oc { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.oc::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--grey); flex: none; }
.oc.ok::before { background: var(--c-ok); } .oc.refused::before { background: var(--c-refused); } .oc.silent::before { background: var(--c-silent); } .oc.bus::before { background: var(--c-bus); } .oc.adapter::before { background: var(--c-adapter); }
.oc.ok { color: var(--secondary); font-weight: 500; }

/* ---------- timeline strip ---------- */
.tl-svg { width: 100%; height: 64px; display: block; cursor: crosshair; border-radius: 6px; background: var(--surface2); touch-action: none; }
.tl-sel { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1; }

/* ---------- connector ---------- */
.conn-wrap { display: flex; flex-direction: column; gap: 8px; }
.conn { width: 100%; max-width: 420px; height: auto; display: block; }
.conn-body { fill: var(--surface2); stroke: var(--hairline); stroke-width: 1.5; }
.pin circle { fill: var(--surface); stroke: var(--quaternary); stroke-width: 1.5; transition: fill .15s; }
.pin .pin-n { font: 600 10px var(--font); fill: var(--tertiary); pointer-events: none; }
.pin .pin-l { font: 500 9.5px var(--font); fill: var(--tertiary); pointer-events: none; }
.pin.data circle { fill: var(--accent); stroke: var(--accent); } .pin.data .pin-n { fill: var(--on-accent); } .pin.data .pin-l { fill: var(--accent); font-weight: 700; }
.pin.power circle { fill: color-mix(in srgb, var(--blue) 30%, var(--surface)); stroke: var(--blue); } .pin.power .pin-n { fill: var(--label); } .pin.power .pin-l { fill: var(--blue); }
.pin:focus { outline: none; } .pin:focus circle { stroke: var(--label); stroke-width: 2.5; }
.sw-data { background: var(--accent); } .sw-power { background: var(--blue); } .sw-idle { background: var(--quaternary); }

/* ---------- sequence lanes ---------- */
.lanes { display: block; font-family: var(--mono); max-width: none; }
.lanes-wrap { max-height: 560px; overflow: auto; }
.lane-h { font: 600 11px var(--font); fill: var(--secondary); }
.lane-l { stroke: var(--hairline); stroke-dasharray: 3 3; }
.lane-t { font-size: 10px; fill: var(--secondary); }
.lane-t.faint-t { fill: var(--tertiary); }
.lane-row { cursor: pointer; }
.lane-row:hover .lane-t, .lane-row:focus .lane-t { fill: var(--label); }
.lane-row:focus { outline: none; }
.arr { stroke-width: 2; stroke: var(--grey); }
.arr-tx { stroke: var(--secondary); stroke-width: 1.5; }
.arr-ok { stroke: var(--c-ok); } .arr-refused { stroke: var(--c-refused); } .arr-silent { stroke: var(--c-silent); } .arr-bus { stroke: var(--c-bus); } .arr-adapter { stroke: var(--c-adapter); }
text.arr-ok, text.arr-refused, text.arr-silent, text.arr-bus, text.arr-adapter { stroke: none; }
text.arr-silent { fill: var(--c-silent); } text.arr-bus { fill: var(--c-bus); } text.arr-adapter { fill: var(--c-adapter); } text.arr-refused { fill: var(--c-refused); }

/* ---------- trend / scatter ---------- */
.trend-svg, .scatter { width: 100%; height: auto; display: block; }
.trend-svg .grid, .scatter .grid { stroke: var(--hairline-soft); }
.trend-svg .axis, .scatter .axis { font: 10px var(--font); fill: var(--tertiary); }
.band { fill: var(--accent-soft); } .band.proj { fill: color-mix(in srgb, var(--accent) 8%, transparent); stroke: var(--accent); stroke-dasharray: 3 4; stroke-width: .8; }
.fitline { fill: none; stroke: var(--accent); stroke-width: 2; } .fitline.proj { stroke-dasharray: 5 5; }
.now-line { stroke: var(--quaternary); stroke-dasharray: 2 3; }
.pt { fill: var(--label); } .pt.dim { fill: var(--accent); opacity: .55; }
.trend-svg .pt:focus { outline: none; stroke: var(--accent); stroke-width: 2; }
.trend-empty { padding: 24px 0; text-align: center; }

/* ---------- trace page ---------- */
.trace-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--gutter); align-items: start; }
@media (max-width: 1180px) { .trace-grid { grid-template-columns: 1fr; } }
.ex-list { display: flex; flex-direction: column; }
.ex { display: grid; grid-template-columns: 96px minmax(120px, 190px) minmax(0, 1fr) 150px 70px; gap: 10px; align-items: center; min-height: 34px; padding: 4px 12px; border-bottom: 1px solid var(--hairline-soft); font-size: var(--t-subhead); cursor: pointer; }
.ex:hover { background: var(--surface2); }
.ex[aria-expanded="true"] { background: var(--surface2); }
.ex.at { color: var(--secondary); }
.ex .mono { font-size: 12px; }
.ex-clock { color: var(--tertiary); font-size: var(--t-foot); }
.ex-tx { font-family: var(--mono); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-mean { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--secondary); }
.ex-val { color: var(--label); }
.ex-lat { text-align: right; color: var(--tertiary); font-size: var(--t-foot); }
.ex-detail { padding: 10px 14px 14px 18px; border-bottom: 1px solid var(--hairline-soft); background: color-mix(in srgb, var(--surface2) 55%, transparent); font-size: var(--t-subhead); display: flex; flex-direction: column; gap: 10px; }
.ex-detail h4 { margin: 0; font-size: var(--t-foot); color: var(--tertiary); font-weight: 600; }
.wire { font-family: var(--mono); font-size: 12px; margin: 0; white-space: pre-wrap; word-break: break-all; color: var(--label); }
.wire .tx { color: var(--accent); } .wire .rx { color: var(--label); } .wire .note { color: var(--teal); } .wire .dt { color: var(--tertiary); }
.frames { display: grid; grid-template-columns: auto auto 1fr; gap: 2px 14px; font-family: var(--mono); font-size: 12px; }
.frames .h { color: var(--tertiary); font-family: var(--font); font-size: 11px; }
.decode-row { display: grid; grid-template-columns: minmax(140px, 220px) minmax(0, 1fr); gap: 4px 14px; padding: 6px 0; border-top: 1px solid var(--hairline-soft); }
.decode-row:first-child { border-top: 0; }
.decode-v { font-weight: 600; }
.steps { font-family: var(--mono); font-size: var(--t-foot); color: var(--secondary); overflow-wrap: anywhere; }
.why { padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, var(--c-bus) 10%, transparent); color: var(--label); }
.why.refused { background: color-mix(in srgb, var(--c-refused) 12%, transparent); } .why.silent { background: color-mix(in srgb, var(--c-silent) 12%, transparent); } .why.adapter { background: color-mix(in srgb, var(--c-adapter) 12%, transparent); }
@media (max-width: 760px) {
  .ex { grid-template-columns: 70px minmax(0, 1fr) 70px; }
  .ex-mean, .ex-oc { display: none; }
  .decode-row { grid-template-columns: 1fr; }
}
.facts.tight { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 16px; }
.facts.tight .fact dd { font-size: var(--t-callout); }
.source-note { font-size: 12px; color: var(--secondary); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: var(--t-subhead); }
.kv dt { color: var(--secondary); } .kv dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- layers (learn + trace) ---------- */
.layers { display: flex; flex-direction: column; gap: 6px; }
.layer { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--hairline-soft); border-radius: 10px; background: var(--surface); text-align: left; color: inherit; font: inherit; cursor: pointer; width: 100%; }
.layer:hover { border-color: var(--hairline); background: var(--surface2); }
.layer[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.layer-n { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font: 600 12px var(--font); background: var(--surface2); color: var(--secondary); }
.layer.ok .layer-n { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green); }
.layer.fail .layer-n { background: color-mix(in srgb, var(--red) 18%, transparent); color: var(--red); }
.layer.mixed .layer-n { background: color-mix(in srgb, var(--orange) 18%, transparent); color: var(--orange); }
.layer-name { font-weight: 600; font-size: var(--t-callout); }
.layer-what { font-size: 12px; color: var(--secondary); }
.layer-facts { font-size: 12px; color: var(--tertiary); margin-top: 2px; }
.layer-state { font-size: var(--t-foot); font-weight: 600; white-space: nowrap; }
.layer.ok .layer-state { color: var(--green); } .layer.fail .layer-state { color: var(--red); } .layer.mixed .layer-state { color: var(--orange); } .layer.unknown .layer-state { color: var(--tertiary); }
.chain-arrow { text-align: center; color: var(--quaternary); font-size: 12px; line-height: 1; margin: -2px 0; }

/* ---------- explorer ---------- */
.byte-grid { display: flex; gap: 6px; flex-wrap: wrap; }
.byte { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 8px; border-radius: 8px; background: var(--surface2); border: 1px solid transparent; font-family: var(--mono); cursor: pointer; color: inherit; min-width: 74px; }
.byte[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.byte-l { font: 600 11px var(--font); color: var(--secondary); }
.byte-h { font-size: 16px; font-weight: 600; }
.byte-b { font-size: var(--t-caption); color: var(--tertiary); letter-spacing: .06em; }
.bitlanes { height: 260px; }
.ctrl-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.ctrl-row .field { flex: 0 1 150px; }
.ctrl-row .input, .ctrl-row .select { height: 34px; }
.formula { font-family: var(--mono); font-size: 13px; padding: 8px 10px; border-radius: 8px; background: var(--surface2); overflow-wrap: anywhere; }
.r-line { font-size: 13px; }
.explore-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: var(--gutter); align-items: start; }
@media (max-width: 1080px) { .explore-grid { grid-template-columns: 1fr; } }
.pick-list { display: flex; flex-direction: column; max-height: 520px; overflow: auto; }
.pick { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; text-align: left; border: 0; background: none; color: inherit; font: inherit; padding: 7px 10px; border-radius: 7px; cursor: pointer; font-size: var(--t-subhead); }
.pick:hover { background: var(--surface2); }
.pick[aria-pressed="true"] { background: var(--accent-soft); }
.pick .mono { font-weight: 600; }

/* ---------- missing data ---------- */
.status-bar-stack { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--track); min-width: 120px; }
.status-bar-stack i { display: block; height: 100%; }
.st-good { background: var(--green); } .st-bad { background: var(--red); } .st-info { background: var(--blue); } .st-warn { background: var(--yellow); } .st-idle { background: var(--quaternary); }

/* ---------- live ---------- */
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: var(--gutter); }
.live-card .card-head { margin-bottom: 10px; }
.live-now { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.live-now .chip { min-width: 0; }
.tail { font-family: var(--mono); font-size: var(--t-foot); max-height: 220px; overflow: auto; background: var(--surface2); border-radius: 8px; padding: 8px 10px; margin: 0; white-space: pre-wrap; word-break: break-all; }
.tail .tx { color: var(--accent); } .tail .note { color: var(--teal); } .tail .dt { color: var(--tertiary); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 60%, transparent); animation: pulse 2s infinite; display: inline-block; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.metric-table td.k { color: var(--secondary); }

/* ---------- analytics ---------- */
.trend-card .trend-words { font-size: var(--t-subhead); color: var(--secondary); margin-top: 8px; }
.trend-card .trend-words.refuse { color: var(--tertiary); font-style: italic; }
.week-bars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(10px, 1fr); align-items: end; gap: 2px; height: 120px; }
.week-bars i { display: block; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 1px; }

/* ---------- compact row lists (overview, live) ---------- */
.stack-list { display: flex; flex-direction: column; }
.mini-row { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 8px; color: inherit; font-size: 13px; border-bottom: 1px solid var(--hairline-soft); }
.mini-row:last-child { border-bottom: 0; }
.mini-row:hover { background: var(--surface2); text-decoration: none; }
.mini-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.mini-row .faint { font-size: 12px; }

/* ---------- accounts ---------- */
.acct { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; padding: 12px 4px; border-bottom: 1px solid var(--hairline-soft); flex-wrap: wrap; }
.acct:last-child { border-bottom: 0; }
.acct-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 320px; font-size: 13px; }
.acct-devs { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.acct-dev { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: var(--t-subhead); }
.col { display: flex; flex-direction: column; gap: var(--gutter); min-width: 0; }
.ecu-row { border: 0; background: none; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.ecu-row[aria-pressed="true"] { background: var(--accent-soft); }
.ex-card .filters { padding: 0 var(--inset); }
.ex-card .ex-list { border-top: 1px solid var(--hairline-soft); }
.pick-sub { display: flex; flex-wrap: wrap; gap: 2px; padding: 0 8px 6px 18px; }
.pick-sub .btn { height: 24px; padding: 0 6px; }
.scatter-host .scatter { max-width: 420px; }

/* ---------- learn ---------- */
.learn-grid { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: var(--gutter); align-items: start; }
@media (max-width: 1080px) { .learn-grid { grid-template-columns: 1fr; } }
.teach { font-size: 14px; line-height: 1.55; margin: 0 0 10px; max-width: 72ch; }
.facts-list { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: var(--secondary); }
.anat { display: flex; gap: 6px; flex-wrap: wrap; }
.anat-part { border-radius: 8px; padding: 8px 10px; background: var(--surface2); border-top: 3px solid var(--quaternary); min-width: 90px; }
.anat-part.id { border-top-color: var(--blue); } .anat-part.pci { border-top-color: var(--purple); } .anat-part.svc { border-top-color: var(--green); } .anat-part.pid { border-top-color: var(--teal); } .anat-part.data { border-top-color: var(--accent); }
.anat-b { font-size: 15px; font-weight: 600; }
.anat-w { font-size: var(--t-foot); color: var(--secondary); max-width: 200px; }
.ctrl-row .field:last-child { flex-basis: 240px; }
.filters .select.wide { flex: 0 1 420px; min-width: 260px; }

/* ---------- session: data collected ---------- */
.collected-head { display: flex; gap: 18px; align-items: baseline; flex-wrap: wrap; }
.collected-n { font-size: 30px; font-weight: 300; letter-spacing: -.03em; }
.collected-n .faint { font-size: 14px; letter-spacing: 0; }
