/* ==========================================================================
   PIVAI Platform — software mock-ups
   Each mock-up is laid out at a fixed 1180px design width inside .mock-stage
   and scaled to fit its container by site.js, so it stays pixel-crisp.
   ========================================================================== */

.mock-stage { position: relative; width: 100%; }
.mock-stage .app { width: 1180px; transform-origin: 0 0; transform: scale(var(--s, 1)); position: absolute; left: 0; top: 0; }
.no-js .mock-stage { overflow-x: auto; }
.no-js .mock-stage .app { position: relative; }

.app {
  --a-bg: #0d0f12; --a-panel: #14171c; --a-panel-2: #1a1e24; --a-line: rgba(255,255,255,.08);
  --a-text: #e8eaed; --a-dim: #8b929c; --a-faint: #5c636d; --a-accent: #f5a524; --a-ok: #3fb67a; --a-bad: #e5484d; --a-blue: #3a8dff;
  font-family: "Inter", "Inter Tight", system-ui, sans-serif; font-size: 12px; line-height: 1.4; color: var(--a-text);
  background: var(--a-bg); border: 1px solid rgba(255,255,255,.14); border-radius: 12px; overflow: hidden;
  box-shadow: 0 40px 120px rgba(0,0,0,.55), 0 0 0 1px rgba(0,0,0,.6);
  user-select: none;
}
.light .app { box-shadow: 0 40px 100px rgba(10,10,11,.28), 0 0 0 1px rgba(0,0,0,.2); }
.app * { box-sizing: border-box; }
.app .mono { font-family: "IBM Plex Mono", ui-monospace, monospace; }

/* Title bar */
.app-bar { height: 40px; display: flex; align-items: center; gap: 14px; padding: 0 14px; background: #0a0b0e; border-bottom: 1px solid var(--a-line); }
.app-bar .dots { display: flex; gap: 6px; }
.app-bar .dots i { width: 10px; height: 10px; border-radius: 50%; background: #2b2f36; display: block; }
.app-bar .ttl { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 12.5px; }
.app-bar .ttl img { height: 14px; width: auto; opacity: .9; }
.app-bar .ttl span { color: var(--a-dim); font-weight: 500; }
.app-bar .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 5px; background: var(--a-panel-2); color: var(--a-dim); font-size: 11px; font-weight: 500; white-space: nowrap; }
.chip b { color: var(--a-text); font-weight: 600; }
.chip.ok { color: var(--a-ok); background: rgba(63,182,122,.12); }
.chip.rec { color: #fff; background: var(--a-bad); }
.chip.rec::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: recBlink 1.2s infinite; }
.chip.amber { color: var(--a-accent); background: rgba(245,165,36,.12); }
@keyframes recBlink { 50% { opacity: .25; } }

.app-body { display: grid; height: 640px; }
.pane { background: var(--a-panel); border-right: 1px solid var(--a-line); padding: 14px; display: flex; flex-direction: column; gap: 14px; overflow: hidden; }
.pane:last-child { border-right: 0; border-left: 1px solid var(--a-line); }
.pane h6 { margin: 0; font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--a-faint); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; }
.kv dt { color: var(--a-dim); }
.kv dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.kv dd.ok { color: var(--a-ok); }
.ctl { display: flex; align-items: center; justify-content: center; gap: 8px; height: 32px; border-radius: 7px; border: 1px solid var(--a-line); background: var(--a-panel-2); font-weight: 600; color: var(--a-text); font-size: 12px; }
.ctl.primary { background: var(--a-bad); border-color: transparent; color: #fff; }
.ctl.accent { background: var(--a-accent); border-color: transparent; color: #111; }
.ctl.okb { background: var(--a-ok); border-color: transparent; color: #08130d; }
.ctl kbd { font-family: "IBM Plex Mono", monospace; font-size: 10px; padding: 1px 5px; border-radius: 3px; background: rgba(0,0,0,.25); }
.ctl-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--a-ok); display: inline-block; box-shadow: 0 0 0 3px rgba(63,182,122,.15); }
.row-list { display: grid; gap: 8px; }
.row-list > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.row-list span { color: var(--a-dim); display: flex; align-items: center; gap: 8px; }

.statusbar { height: 28px; display: flex; align-items: center; gap: 18px; padding: 0 14px; border-top: 1px solid var(--a-line); background: #0a0b0e; color: var(--a-faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.statusbar b { color: var(--a-dim); font-weight: 600; }
.statusbar .push { margin-left: auto; }

/* Bars */
.bars { display: grid; gap: 9px; }
.bar { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; }
.bar .n { font-weight: 700; font-variant-numeric: tabular-nums; }
.bar .track { grid-column: 1 / -1; height: 4px; border-radius: 3px; background: var(--a-panel-2); overflow: hidden; }
.bar .track i { display: block; height: 100%; border-radius: 3px; background: var(--c, var(--a-accent)); }
.bar .lbl { display: flex; align-items: center; gap: 7px; color: var(--a-dim); }
.bar .lbl::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--c, var(--a-accent)); }

/* ---------------------------------------------------------------- Argus Live */
.argus .app-body { grid-template-columns: 210px 1fr 270px; }
.argus .viewport { position: relative; background: #000; display: flex; flex-direction: column; }
.argus .feed { position: relative; flex: 1; overflow: hidden; }
.argus .feed { background: #000 url("media/argus-loop-poster.jpg") center / cover no-repeat; }
.argus .feed video, .argus .feed img { width: 100%; height: 100%; object-fit: cover; }
/* YouTube clip sized to cover the 700×570 feed (16:9 → 1014×570), no interaction */
.argus .feed .yt-feed { position: absolute; top: 50%; left: 50%; width: 1014px; height: 570px; border: 0; transform: translate(-50%, -50%) scale(1.06); pointer-events: none; }
.hud { position: absolute; inset: 0; pointer-events: none; font-family: "IBM Plex Mono", monospace; }
.hud .tl, .hud .tr, .hud .bl, .hud .br { position: absolute; display: flex; gap: 6px; }
.hud .tl { left: 12px; top: 12px; } .hud .tr { right: 12px; top: 12px; }
.hud .bl { left: 12px; bottom: 12px; } .hud .br { right: 12px; bottom: 12px; }
.hud .box { padding: 5px 8px; border-radius: 5px; background: rgba(0,0,0,.62); backdrop-filter: blur(4px); color: #fff; font-size: 11px; }
.hud .box b { font-size: 18px; font-family: "Inter", sans-serif; display: block; line-height: 1.1; }
.hud .reticle { position: absolute; left: 50%; top: 50%; width: 28px; height: 28px; margin: -14px 0 0 -14px; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; }
.timeline { height: 70px; background: #0a0b0e; border-top: 1px solid var(--a-line); padding: 10px 14px; display: grid; grid-template-rows: auto 1fr; gap: 6px; }
.timeline .tt { display: flex; justify-content: space-between; color: var(--a-faint); font-size: 10.5px; }
.ticks { position: relative; background: repeating-linear-gradient(90deg, transparent 0 39px, rgba(255,255,255,.05) 39px 40px); border-radius: 4px; }
.ticks i { position: absolute; bottom: 0; width: 3px; border-radius: 2px; background: var(--c); }
.ticks .head { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--a-accent); left: 78%; }
.minimap { border-radius: 8px; overflow: hidden; background: #0e1217; border: 1px solid var(--a-line); height: 170px; position: relative; }
.minimap svg { width: 100%; height: 100%; }

/* ---------------------------------------------------------------- Atlas Capture */
.atlas .app-body { grid-template-columns: 1fr 290px; }
.atlas .main { display: grid; grid-template-rows: auto auto 1fr; gap: 12px; padding: 14px; background: var(--a-bg); }
.cams { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cam { border-radius: 8px; overflow: hidden; background: #000; border: 1px solid var(--a-line); }
.cam .img { aspect-ratio: 4/3; background-image: url("media/crack-segmentation.jpg"); background-size: 400% 300%; position: relative; filter: saturate(.85); }
.cam .img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 70%, rgba(0,0,0,.6)); }
.cam .img .lab { position: absolute; left: 8px; top: 8px; z-index: 1; font-family: "IBM Plex Mono", monospace; font-size: 10.5px; padding: 3px 6px; border-radius: 4px; background: rgba(0,0,0,.65); }
.cam .img .live { position: absolute; right: 8px; top: 8px; z-index: 1; }
.cam .meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 8px 10px; background: var(--a-panel); font-size: 10.5px; color: var(--a-dim); font-variant-numeric: tabular-nums; }
.cam .meta b { display: block; color: var(--a-text); font-size: 12px; }
.hist { height: 22px; display: flex; align-items: flex-end; gap: 1px; padding: 0 10px 8px; background: var(--a-panel); }
.hist i { flex: 1; background: rgba(245,165,36,.55); border-radius: 1px 1px 0 0; }
.coverage { border-radius: 8px; border: 1px solid var(--a-line); background: var(--a-panel); padding: 12px 14px; }
.coverage .top { display: flex; justify-content: space-between; color: var(--a-dim); margin-bottom: 10px; }
.coverage svg { width: 100%; height: 120px; }
.capgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tile { border-radius: 8px; border: 1px solid var(--a-line); background: var(--a-panel); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.tile span { color: var(--a-dim); font-size: 11px; }
.tile b { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tile b small { font-size: 12px; color: var(--a-dim); font-weight: 500; margin-left: 3px; }
.gauge { position: relative; height: 120px; display: grid; place-items: center; }
.gauge svg { width: 200px; height: 120px; }
.gauge .val { position: absolute; bottom: 8px; text-align: center; }
.gauge .val b { font-size: 30px; font-weight: 700; display: block; line-height: 1; }
.gauge .val span { color: var(--a-dim); font-size: 11px; }
.attitude { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.attitude div { background: var(--a-panel-2); border-radius: 6px; padding: 8px 4px; }
.attitude span { color: var(--a-dim); font-size: 10.5px; display: block; }
.attitude b { font-size: 14px; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- Map */
.map .app-body { grid-template-columns: 230px 1fr 280px; }
.map .canvas { position: relative; background: #0b0e12; overflow: hidden; }
.map .canvas > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--a-dim); }
.toggle .sw { width: 28px; height: 16px; border-radius: 999px; background: var(--a-panel-2); position: relative; border: 1px solid var(--a-line); flex: none; }
.toggle .sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--a-faint); }
.toggle.on { color: var(--a-text); }
.toggle.on .sw { background: rgba(245,165,36,.25); border-color: rgba(245,165,36,.5); }
.toggle.on .sw::after { left: 14px; background: var(--a-accent); }
.rating-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.rating-chips span { height: 22px; padding: 0 8px; border-radius: 5px; display: inline-flex; align-items: center; gap: 6px; background: var(--a-panel-2); color: var(--a-dim); font-size: 11px; }
.rating-chips span::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--c); }
.legend { position: absolute; left: 14px; bottom: 14px; background: rgba(13,15,18,.88); border: 1px solid var(--a-line); border-radius: 8px; padding: 10px 12px; backdrop-filter: blur(6px); }
.legend .scale { display: flex; gap: 2px; margin: 6px 0 4px; }
.legend .scale i { width: 34px; height: 6px; border-radius: 2px; background: var(--c); }
.legend .ends { display: flex; justify-content: space-between; color: var(--a-faint); font-size: 10px; }
.map-tools { position: absolute; right: 14px; top: 14px; display: grid; gap: 4px; }
.map-tools i { width: 30px; height: 30px; border-radius: 7px; background: rgba(13,15,18,.88); border: 1px solid var(--a-line); display: grid; place-items: center; color: var(--a-dim); font-style: normal; font-weight: 600; font-size: 14px; }
.popup { position: absolute; left: 470px; top: 118px; width: 230px; background: rgba(20,23,28,.97); border: 1px solid rgba(245,165,36,.45); border-radius: 10px; padding: 12px; box-shadow: 0 18px 40px rgba(0,0,0,.5); }
.popup::after { content: ""; position: absolute; left: -7px; top: 34px; width: 12px; height: 12px; background: rgba(20,23,28,.97); border-left: 1px solid rgba(245,165,36,.45); border-bottom: 1px solid rgba(245,165,36,.45); transform: rotate(45deg); }
.popup .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.popup .cci { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.popup .cci b { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; }
.pillr { height: 20px; padding: 0 8px; border-radius: 4px; display: inline-flex; align-items: center; font-weight: 700; font-size: 10.5px; color: #111; background: var(--c); }
.ortho-thumb { border-radius: 8px; overflow: hidden; border: 1px solid var(--a-line); aspect-ratio: 4/3; background: url("media/atlas-ortho-split.jpg") 100% 50% / 200% auto no-repeat; position: relative; }
.ortho-thumb span { position: absolute; left: 8px; bottom: 8px; font-family: "IBM Plex Mono", monospace; font-size: 10px; padding: 3px 6px; border-radius: 4px; background: rgba(0,0,0,.7); }
.spark { width: 100%; height: 60px; }

/* ---------------------------------------------------------------- Review */
.review .app-body { grid-template-columns: 270px 1fr 270px; }
.queue { display: grid; gap: 6px; overflow: hidden; }
.qitem { display: grid; grid-template-columns: 46px 1fr auto; gap: 10px; align-items: center; padding: 7px; border-radius: 8px; border: 1px solid transparent; }
.qitem.sel { background: rgba(245,165,36,.08); border-color: rgba(245,165,36,.45); }
.qitem .th { width: 46px; height: 46px; border-radius: 6px; background-image: url("media/crack-segmentation.jpg"); background-size: 400% 300%; }
.qitem .t b { display: block; font-size: 12px; }
.qitem .t span { color: var(--a-dim); font-size: 11px; }
.st { height: 18px; padding: 0 6px; border-radius: 4px; font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; }
.st.acc { background: rgba(63,182,122,.15); color: var(--a-ok); }
.st.rej { background: rgba(229,72,77,.15); color: #ff8a8d; }
.st.pen { background: var(--a-panel-2); color: var(--a-dim); }
.progress { height: 6px; border-radius: 4px; background: var(--a-panel-2); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--a-accent); }
.review .stage { position: relative; background: #07080a; display: grid; grid-template-rows: 44px 1fr 44px; }
.review .tools { display: flex; align-items: center; gap: 4px; padding: 0 10px; border-bottom: 1px solid var(--a-line); }
.review .tools i { height: 28px; min-width: 28px; padding: 0 8px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; color: var(--a-dim); font-style: normal; font-size: 11.5px; }
.review .tools i.on { background: var(--a-panel-2); color: var(--a-text); }
.review .tools .sep { width: 1px; height: 18px; background: var(--a-line); margin: 0 6px; }
.review .canvas { position: relative; overflow: hidden; display: grid; place-items: center; }
.review .canvas .shot { width: 92%; aspect-ratio: 4/3; max-height: 92%; border-radius: 6px; background-image: url("media/crack-segmentation.jpg"); background-size: 400% 300%; background-position: 33.333% 50%; position: relative; box-shadow: 0 0 0 1px rgba(255,255,255,.08); }
.review .canvas .bbox { position: absolute; border: 2px dashed var(--a-accent); border-radius: 4px; }
.review .canvas .bbox span { position: absolute; left: -2px; top: -22px; background: var(--a-accent); color: #111; font-weight: 700; font-size: 10.5px; padding: 2px 6px; border-radius: 3px 3px 0 0; white-space: nowrap; }
.review .canvas .ruler { position: absolute; height: 2px; background: #fff; }
.review .canvas .ruler span { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-family: "IBM Plex Mono", monospace; font-size: 10.5px; background: #fff; color: #111; padding: 1px 5px; border-radius: 3px; white-space: nowrap; }
.review .foot { display: flex; align-items: center; gap: 10px; padding: 0 12px; border-top: 1px solid var(--a-line); color: var(--a-dim); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: var(--a-panel-2); padding: 3px; border-radius: 7px; }
.seg span { text-align: center; padding: 5px 0; border-radius: 5px; color: var(--a-dim); font-weight: 600; }
.seg span.on { background: var(--a-accent); color: #111; }
.select { height: 32px; border-radius: 7px; border: 1px solid var(--a-line); background: var(--a-panel-2); display: flex; align-items: center; justify-content: space-between; padding: 0 10px; font-weight: 600; }
.select::after { content: "▾"; color: var(--a-dim); }
.select i { width: 8px; height: 8px; border-radius: 2px; background: var(--c); display: inline-block; margin-right: 8px; }

/* ---------------------------------------------------------------- Reports */
.reports .app-body { grid-template-columns: 1fr 360px; }
.reports .main { padding: 16px; display: grid; grid-template-rows: auto 1fr; gap: 14px; background: var(--a-bg); }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.kpis .tile b { font-size: 26px; }
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chart { border-radius: 8px; border: 1px solid var(--a-line); background: var(--a-panel); padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.chart .ch { display: flex; justify-content: space-between; align-items: center; }
.chart .ch b { font-size: 12.5px; }
.chart .ch span { color: var(--a-faint); font-size: 11px; }
.vbars { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; align-items: end; min-height: 200px; }
.vbars div { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.vbars i { width: 100%; border-radius: 4px 4px 0 0; background: var(--c); }
.vbars span { color: var(--a-dim); font-size: 10px; text-align: center; line-height: 1.2; }
.vbars em { font-style: normal; font-weight: 700; font-size: 11px; }
.chart.wide { grid-column: 1 / -1; }
.chart svg { width: 100%; height: 130px; }
.files { display: grid; gap: 8px; }
.file { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 8px; background: var(--a-panel-2); border: 1px solid var(--a-line); }
.file .fi { width: 36px; height: 40px; border-radius: 5px; display: grid; place-items: center; font-family: "IBM Plex Mono", monospace; font-size: 9.5px; font-weight: 700; color: #111; background: var(--c, #ccc); }
.file b { display: block; font-size: 12px; }
.file span { color: var(--a-dim); font-size: 11px; }
.file .ok { color: var(--a-ok); font-size: 14px; }
.integr { display: flex; gap: 6px; flex-wrap: wrap; }
.integr span { height: 24px; padding: 0 9px; border-radius: 5px; border: 1px solid var(--a-line); display: inline-flex; align-items: center; color: var(--a-dim); font-size: 11px; }

/* ---------------------------------------------------------------- Showcase tabs */
.mock-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 22px; }
.mock-tabs button { height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-dark, rgba(255,255,255,.12)); background: none; color: var(--ink-dim, #aaa); font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.mock-tabs button em { font-style: normal; font-family: "IBM Plex Mono", monospace; font-size: 11px; color: var(--ink-faint, #777); }
.mock-tabs button.is-active { background: var(--ink, #fff); color: var(--black, #000); border-color: transparent; }
.mock-tabs button.is-active em { color: rgba(0,0,0,.5); }
.mock-panel[hidden] { display: none; }
.mock-note { margin-top: 14px; font-family: "IBM Plex Mono", monospace; font-size: 11.5px; letter-spacing: .06em; color: var(--ink-faint, #777); }
