:root {
  --orange: #FF6B00; --orange-deep: #E65C00; --orange-ink: #803600; --orange-soft: #FFF2E8;
  --grey: #7B868C; --grey-soft: #EEF1F3;
  --black: #070707; --ink: #2B2B2B; --paper: #F6F6F6; --white: #FFF;
  --line: #E5E5E5; --line-2: #D8D8D8;
  --green: #157539; --green-soft: #E6F7EE; --red: #CC4B37; --red-soft: #FBEDEA;
  --amber: #805700; --amber-soft: #FFF6E5;
  --mono: ui-monospace, "JetBrains Mono", Consolas, monospace;
  --ui: system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--ui); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; padding-bottom: 76px; }

.hdr { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: rgba(255,255,255,.94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.hdr .brand { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.hdr .brand img { height: 28px; }
.hdr .brand b { color: var(--orange-ink); }
.conn { display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11px; padding: 4px 10px; border-radius: 99px; background: var(--green-soft); color: var(--green); border: 1px solid #BEE7D2; }
.conn.off { background: var(--amber-soft); color: var(--amber); border-color: #F2E0B6; }
.conn .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

main { max-width: 760px; margin: 0 auto; padding: 16px 14px 24px; }
.view { display: none; }
.view.active { display: block; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
h1 { font-size: 22px; color: var(--black); }

.stack { display: flex; flex-direction: column; gap: 10px; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 16px; box-shadow: 0 1px 2px rgba(7,7,7,.05); }
.card.click { cursor: pointer; transition: border-color .15s; }
.card.click:hover { border-color: var(--orange); }

.job-id { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--orange-ink); }
.job-title { font-weight: 700; color: var(--black); font-size: 15px; margin: 2px 0 8px; }
.row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.tag { display: inline-flex; align-items: center; font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.tag-state { background: var(--grey-soft); color: #4b5560; border: 1px solid var(--line-2); }
.tag-ok { background: var(--green-soft); color: var(--green); border: 1px solid #BEE7D2; }
.tag-warn { background: var(--amber-soft); color: var(--amber); border: 1px solid #F2E0B6; }
.tag-fail { background: var(--red-soft); color: var(--red); border: 1px solid #F0CFC8; }
.tag-hold { background: var(--orange-soft); color: var(--orange-ink); border: 1px solid #FFD9B8; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 18px; border-radius: 12px; border: none; background: var(--orange); color: #fff; font: inherit; font-weight: 700; font-size: 14.5px; cursor: pointer; }
.btn:hover { background: var(--orange-deep); }
.btn.ghost { background: var(--white); color: var(--ink); border: 1.5px solid var(--line-2); }
.btn.ghost:hover { border-color: var(--black); background: var(--white); }
.btn.dark { background: var(--black); }
.btn.green { background: var(--green); }
.btn.danger { background: var(--white); color: var(--red); border: 1.5px solid #F0CFC8; }
.btn.wide { width: 100%; margin-top: 12px; }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: 13px; border-radius: 10px; }

.input { width: 100%; min-height: 44px; border: 1.5px solid var(--line-2); border-radius: 12px; padding: 10px 12px; font: inherit; margin-bottom: 10px; background: var(--white); color: var(--ink); }
.lbl { display: block; font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--grey); margin-bottom: 4px; }
.dim { color: var(--grey); text-transform: none; letter-spacing: 0; font-weight: 400; }
.mono { font-family: var(--mono); }
.note { font-size: 13px; color: var(--grey); margin-top: 10px; }
.big { font-size: 30px; font-weight: 800; color: var(--black); }

/* ---------- stat cards ---------- */
.statgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
@media (max-width: 860px) { .statgrid { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; box-shadow: 0 1px 2px rgba(7,7,7,.05); }
.stat .num { font-size: 30px; font-weight: 800; color: var(--black); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .lbl { margin-top: 8px; }
.stat-d { font-size: 12px; color: var(--grey); margin-top: 2px; }

/* ---------- ghost scrollbars — everywhere, almost invisible ---------- */
* { scrollbar-width: thin; scrollbar-color: rgba(7,7,7,.14) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(7,7,7,.12); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(7,7,7,.22); }

/* ---------- timeline (compact, rail-friendly) ---------- */
.tl { list-style: none; }
.tl li { display: flex; flex-direction: column; gap: 1px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.tl li:last-child { border-bottom: none; }
.tl .t { font-family: var(--mono); color: var(--grey); font-size: 10px; }
.tl .ty { font-weight: 700; color: var(--orange-ink); font-size: 12px; }
.tl .pl { font-size: 12px; color: var(--grey); overflow-wrap: anywhere; }
.tl-scroll { max-height: 320px; overflow-y: auto; }

/* ---------- home hero + dashboard ---------- */
.hero { background: linear-gradient(135deg, var(--black) 0%, #1E1B16 100%); border-radius: 16px; padding: 30px 24px; color: #fff; margin-bottom: 14px; }
.hero-label { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #FF9A4D; }
.hero h1 { color: #fff; font-size: clamp(22px, 4vw, 30px); margin: 10px 0 8px; line-height: 1.22; letter-spacing: -.01em; }
.hero-lede { color: #C9CDD2; font-size: 15px; margin: 0 0 18px; max-width: 560px; }
.hero-ghost { background: transparent; color: #fff; border: 1.5px solid #4A4A4A; }
.hero-ghost:hover { border-color: #fff; background: transparent; }
.chip-step em { font-style: normal; margin-left: 7px; background: var(--black); color: #fff; border-radius: 99px; padding: 1px 7px; font-size: 10px; }
.chip-step em.zero { opacity: .3; }

.gate { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 2px; border-bottom: 1px dashed var(--line); font-size: 13.5px; flex-wrap: wrap; }
.gate:last-child { border-bottom: none; }
.gate .tag { max-width: 100%; }

.about-row { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.about-row:last-of-type { border-bottom: none; }
.about-row p { margin: 7px 0 0; font-size: 13px; color: var(--ink); }

.job-id, #job-title { overflow-wrap: anywhere; }

.findings li { padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; list-style: none; }
.findings li:last-child { border: none; }
.sev-c { color: var(--red); font-weight: 700; }
.sev-w { color: var(--amber); font-weight: 700; }

.pdf-frame { width: 100%; height: 460px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--white); }

/* ---------- app shell ---------- */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(4, 1fr); background: rgba(255,255,255,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav .nav { padding: 12px 4px 14px; font: inherit; font-size: 12px; font-weight: 700; color: var(--grey); background: none; border: none; cursor: pointer; }
.bottom-nav .nav.active { color: var(--orange-ink); }

.sidebar { display: none; position: fixed; top: 0; left: 0; bottom: 0; width: 220px; background: var(--white); border-right: 1px solid var(--line); padding: 14px 12px 18px; z-index: 45; flex-direction: column; gap: 4px; }
.side-brand { display: flex; align-items: center; gap: 8px; padding: 8px 10px 18px; font-size: 16px; }
.side-brand img { height: 28px; }
.side-brand b { color: var(--orange-ink); }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; border-radius: 10px; border: none; background: none; font: inherit; font-weight: 700; font-size: 14px; color: var(--ink); cursor: pointer; text-align: left; }
.nav-item:hover { background: var(--grey-soft); }
.nav-item.active { background: var(--black); color: #fff; }
.side-foot { margin-top: auto; padding: 10px 6px; }

@media (min-width: 880px) {
  body { padding-bottom: 24px; }
  .sidebar { display: flex; }
  .bottom-nav { display: none; }
  .hdr { margin-left: 220px; }
  .hdr .brand { display: none; }
  main { margin-left: 260px; margin-right: 40px; max-width: 860px; }
}

/* ---------- job detail workspace ---------- */
.jd { display: grid; gap: 14px; }
@media (min-width: 1120px) {
  .jd { grid-template-columns: minmax(0, 1fr) 330px; align-items: start; }
}
.jd-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.jd-rail { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
@media (min-width: 1120px) {
  .jd-rail .stepper { grid-auto-flow: row; }
  .jd-rail .st { display: flex; align-items: center; gap: 10px; text-align: left; }
  .jd-rail .st .k { width: 20px; height: 20px; border-radius: 50%; background: var(--paper); border: 1px solid var(--line-2); display: flex; align-items: center; justify-content: center; flex: none; margin: 0; }
  .jd-rail .st.done .k { background: var(--green); border-color: var(--green); color: #fff; }
  .jd-rail .st.now .k { background: var(--orange); border-color: var(--orange); color: #fff; }
}

/* ---------- guided demo ---------- */
.demo-card { border: 2px dashed var(--orange); background: linear-gradient(135deg, var(--white) 55%, var(--orange-soft)); }
.demo-h { font-size: 18px; color: var(--black); margin: 8px 0 6px; line-height: 1.3; }
.demo-p { font-size: 14.5px; color: var(--ink); margin: 0 0 14px; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 88px; z-index: 60; background: var(--black); color: #fff; font-size: 13.5px; padding: 10px 18px; border-radius: 99px; box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: 92vw; }
.toast.ok { background: var(--green); }

/* ---------- info dots, tooltips, explainers ---------- */
.hdr-right { display: flex; align-items: center; gap: 8px; }
.help-btn { width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--line-2); background: var(--white); font: inherit; font-size: 16px; font-weight: 700; color: var(--orange-ink); cursor: pointer; }
.help-btn:hover { border-color: var(--orange); background: var(--orange-soft); }

.info-dot { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: var(--orange-soft); color: var(--orange-ink); border: 1px solid #FFD9B8; font-family: var(--mono); font-size: 11px; font-weight: 600; cursor: pointer; user-select: none; margin-left: 6px; vertical-align: middle; flex: none; }
.info-dot:active { background: #FFD9B8; }

.tip { position: fixed; z-index: 90; max-width: min(320px, 86vw); background: var(--black); color: #fff; font-size: 13px; line-height: 1.55; padding: 12px 14px; border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.35); opacity: 0; transform: translateY(4px); transition: opacity .18s ease, transform .18s ease; }
.tip.show { opacity: 1; transform: none; }
.tip b { color: #FF9A4D; display: block; margin-bottom: 3px; font-size: 11.5px; font-family: var(--mono); letter-spacing: .08em; text-transform: uppercase; }

.now-box { background: var(--orange-soft); border-left: 4px solid var(--orange); border-radius: 0 12px 12px 0; padding: 14px 16px; font-size: 14.5px; color: var(--ink); box-shadow: 0 1px 2px rgba(7,7,7,.05); }
.now-box .lbl { margin-bottom: 4px; }
.now-box p { margin: 6px 0 0; font-size: 14.5px; line-height: 1.55; }

/* ---------- guided tour ---------- */
#tour-backdrop { position: fixed; inset: 0; background: rgba(7,7,7,.6); z-index: 70; pointer-events: none; }
#tour-spot { position: fixed; z-index: 71; border-radius: 14px; border: 2.5px solid var(--orange); box-shadow: 0 0 0 200vmax rgba(7,7,7,.6); pointer-events: none; transition: top .25s ease, left .25s ease, width .25s ease, height .25s ease; }
#tour-coach { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 75; width: min(560px, 92vw); background: var(--white); border-radius: 16px; padding: 20px 20px 16px; box-shadow: 0 16px 48px rgba(0,0,0,.35); border-top: 4px solid var(--orange); }
#tour-coach .step { font-family: var(--mono); font-size: 11px; color: var(--orange-ink); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
#tour-coach h3 { font-size: 19px; color: var(--black); margin: 8px 0 6px; }
#tour-coach p { font-size: 14.5px; color: var(--ink); margin: 0 0 4px; line-height: 1.5; }
#tour-coach .dots { display: flex; gap: 6px; margin: 12px 0 2px; }
#tour-coach .dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); }
#tour-coach .dots i.on { background: var(--orange); }
.tour-btns { display: flex; gap: 10px; justify-content: space-between; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.tour-btns .row { margin-left: auto; }

/* ---------- pipeline stepper ---------- */
.stepper { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(66px, 1fr); gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 10px; scroll-snap-type: x proximity; }
.st { text-align: center; padding: 7px 4px 9px; border: 1.5px solid var(--line-2); border-radius: 10px; background: var(--white); min-width: 0; scroll-snap-align: start; }
.st .k { display: block; font-family: var(--mono); font-size: 9.5px; color: var(--grey); letter-spacing: .08em; }
.st .n { display: block; font-size: 11.5px; font-weight: 700; color: var(--ink); margin-top: 1px; white-space: nowrap; }
.st.done { border-color: #BEE7D2; background: var(--green-soft); }
.st.done .k { color: var(--green); }
.st.now { border-color: var(--orange); background: var(--orange-soft); box-shadow: 0 0 0 3px rgba(255,107,0,.12); }
.st.now .k { color: var(--orange-ink); }

/* ---------- workflow strip ---------- */
.wf-steps { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 2px; }
.chip-step { font-family: var(--mono); font-size: 11px; padding: 6px 10px; border-radius: 99px; background: var(--paper); border: 1px solid var(--line-2); white-space: nowrap; color: var(--ink); flex: none; }
.chip-step b { color: var(--orange-ink); }
.chip-step.done { background: var(--green-soft); border-color: #BEE7D2; }
.chip-step.done b { color: var(--green); }
.chip-step.now { background: var(--orange-soft); border-color: var(--orange); }

/* ---------- render progress log ---------- */
.rbar { height: 6px; background: var(--grey-soft); border-radius: 99px; overflow: hidden; margin: 8px 0 12px; }
.rbar i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--orange), #FF9A4D); transition: width .4s ease; }
.rlog { font-family: var(--mono); font-size: 11.5px; line-height: 1.9; background: var(--black); color: #C9CDD2; border-radius: 10px; padding: 12px 14px; max-height: 180px; overflow-y: auto; }
.rlog .ok { color: #3ADB76; }

/* ---------- review compare ---------- */
.compare { display: grid; gap: 12px; }
.cmp-t { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--grey); margin: 0 0 6px; }
@media (min-width: 960px) { .compare { grid-template-columns: 1fr 1fr; } }

/* ---------- finding chips ---------- */
.chip-pick { display: inline-flex; align-items: center; border: 1.5px solid var(--line-2); border-radius: 99px; padding: 8px 14px; font: inherit; font-size: 12.5px; font-weight: 600; background: var(--white); cursor: pointer; min-height: 36px; }
.chip-pick[aria-pressed="true"] { border-color: var(--red); background: var(--red-soft); color: var(--red); }
