/* Projects board, Project Workspace and Review Center. */

.chip-stage { white-space: nowrap; }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: var(--sp-3); }
.toolbar .select { height: 40px; }
.wrap { flex-wrap: wrap; }
.count-pill { min-width: 24px; height: 22px; padding-inline: 7px; border-radius: 11px; background: var(--surface); color: var(--text-2); font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; border: 1px solid var(--border); }

/* ------------------------------------------------------------------ board by stage */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(262px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 14px; scroll-snap-type: x proximity; }
.board-col { background: var(--surface-3); border-radius: var(--r-lg); padding: 10px; scroll-snap-align: start; min-width: 0; display: flex; flex-direction: column; gap: 10px; align-self: start; }
.board-head { display: flex; align-items: center; gap: 10px; padding: 4px 4px 2px; }
.board-body { display: flex; flex-direction: column; gap: 10px; }
.board-empty { padding: 18px 10px; text-align: center; color: var(--text-3); font-size: var(--fs-sm); border: 1px dashed var(--border-strong); border-radius: var(--r-md); }
.bcard { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); text-decoration: none; color: inherit; position: relative; box-shadow: var(--shadow-1); transition: transform var(--d-base) var(--ease-out), box-shadow var(--d-base); }
.bcard::before { content: ""; position: absolute; inset-block: 8px; inset-inline-start: 0; width: 3px; border-radius: 3px; background: var(--accent); }
.bcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }

/* ------------------------------------------------------------------ workspace */
.ws-path { padding: 20px 24px 22px; margin-bottom: var(--sp-6); }
.ws-path-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.ws-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--sp-6); align-items: start; }
@media (max-width: 1180px) { .ws-grid { grid-template-columns: minmax(0, 1fr); } }

.stepper { list-style: none; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); position: relative; }
.step { position: relative; }
.step::after { content: ""; position: absolute; inset-block-start: 21px; inset-inline-start: 50%; width: 100%; height: 3px; background: var(--border); border-radius: 2px; z-index: 0; }
.step:last-child::after { display: none; }
.step-ok::after { background: var(--success); }
.step-btn { position: relative; z-index: 1; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 0 4px 6px; background: none; border: 0; cursor: pointer; font: inherit; color: var(--text-2); border-radius: var(--r-md); }
.step-btn:hover .step-node { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.step-node { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--border-strong); color: var(--text-3); transition: transform var(--d-base) var(--ease-out), box-shadow var(--d-base), background var(--d-base); }
.step-text { display: flex; flex-direction: column; align-items: center; line-height: 1.3; text-align: center; }
.step-text b { font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); }
.step-text em { font-style: normal; font-size: 11px; color: var(--text-3); direction: ltr; }
.step-ok .step-node { background: var(--success); border-color: var(--success); color: #fff; }
[data-theme="dark"] .step-ok .step-node { color: #04251d; }
.step-wait .step-node { background: var(--attn-soft); border-color: var(--attn); color: var(--attn-text); animation: pulse-ring 2s infinite; }
.step-run .step-node { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-text); }
.step-fail .step-node { background: var(--danger-soft); border-color: var(--danger); color: var(--danger-text); }
.step.is-selected .step-node { box-shadow: 0 0 0 5px var(--focus); }
.step.is-selected .step-text b { color: var(--text); font-weight: 700; }
.step-spin { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--primary-soft-2); border-top-color: var(--primary); animation: spin .8s linear infinite; }
@media (max-width: 759px) {
  .stepper { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .step::after { inset-block-start: 44px; inset-inline-start: 25px; width: 3px; height: calc(100% - 40px); }
  .step-btn { flex-direction: row; text-align: start; gap: 14px; padding: 4px 6px; }
  .step-text { align-items: flex-start; text-align: start; }
}

.stage-panel { overflow: hidden; }
.stage-panel-head { display: flex; gap: 14px; padding: 20px 24px; border-bottom: 1px solid var(--divider); align-items: flex-start; }
.stage-panel-head h2 { font-size: var(--fs-lg); font-weight: 700; }
.stage-panel-body { padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 16px; }
.stage-panel-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; background: var(--surface-2); border-top: 1px solid var(--divider); flex-wrap: wrap; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.facts > div { background: var(--surface-2); border: 1px solid var(--divider); border-radius: var(--r-md); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.facts b { font-size: var(--fs-2xl); line-height: 1.1; }
.facts span { font-size: var(--fs-sm); color: var(--text-3); }
.qa-line { display: flex; gap: 18px; flex-wrap: wrap; font-size: var(--fs-sm); font-weight: 500; }
.qa-line > span { display: inline-flex; gap: 6px; align-items: center; }
.qa-ok { color: var(--success-text); } .qa-warn { color: var(--attn-text); } .qa-block { color: var(--danger-text); }
.qa-line .is-zero { color: var(--text-3); }
.run-box { display: flex; flex-direction: column; gap: 14px; padding: 18px; border: 1px solid var(--primary-soft-2); background: var(--primary-soft); border-radius: var(--r-md); }
.avatar-lg { width: 44px; height: 44px; }

.link-list { list-style: none; }
.link-list li { border-top: 1px solid var(--divider); }
.link-list li:first-child { border-top: 0; }
.link-row { display: flex; align-items: center; gap: 12px; padding: 13px 20px; text-decoration: none; color: var(--text); font-size: var(--fs-md); transition: background var(--d-fast); }
a.link-row:hover { background: var(--surface-2); }
.link-row.is-disabled { opacity: .55; cursor: not-allowed; }
.person-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; }

/* ------------------------------------------------------------------ review center */
.review-page { padding-block-start: var(--sp-2); }
.review { display: grid; grid-template-columns: 300px minmax(0, 1fr); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-1); overflow: hidden; height: calc(100dvh - var(--topbar-h) - 28px); min-height: 520px; }
.rq { border-inline-end: 1px solid var(--border); display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface-2); }
.rq-head { padding: 20px 20px 6px; }
.rq-head h1 { font-size: var(--fs-xl); font-weight: 700; }
.rq-filters { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 16px 12px; }
.rq-list { overflow-y: auto; flex: 1; min-height: 0; }
.rq-item { display: flex; gap: 12px; width: 100%; padding: 14px 16px; text-align: start; background: transparent; border: 0; border-top: 1px solid var(--divider); cursor: pointer; font: inherit; color: inherit; align-items: flex-start; position: relative; transition: background var(--d-fast); }
.rq-item:hover { background: var(--surface-3); }
.rq-item.is-selected { background: var(--surface); }
.rq-item.is-selected::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; background: var(--attn); }
.rq-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.rq-title { font-weight: 700; line-height: 1.35; }
.rq-meta { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text-2); flex-wrap: wrap; }
.rq-flags { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--text-3); }
.rq-time, .rq-flag { display: inline-flex; align-items: center; gap: 4px; }
.rq-flag.warn { color: var(--attn-text); }
.rq-flag.lock { color: var(--info-text); font-weight: 600; }
.rq-item.is-readonly .stage-tile { opacity: .75; }
.rv-slot { min-width: 0; min-height: 0; display: flex; }
.rv-slot > .async { flex: 1; min-width: 0; display: flex; min-height: 0; }
.rv-empty { flex: 1; display: grid; place-items: center; }
.rv { display: grid; grid-template-columns: minmax(0, 1fr) 380px; flex: 1; min-width: 0; min-height: 0; }
.rv-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-inline-end: 1px solid var(--border); }
.rv-head { display: flex; gap: 14px; padding: 18px 24px; border-bottom: 1px solid var(--divider); align-items: flex-start; flex-wrap: wrap; }
.rv-title { font-size: var(--fs-xl); font-weight: 700; line-height: 1.3; }
.rv-back { display: none; }
.rv-doc { padding: 24px 28px 32px; flex: 1; overflow-y: auto; min-height: 0; container-type: inline-size; }
.rv-insp { background: var(--surface-2); min-width: 0; min-height: 0; overflow-y: auto; }
.decision-bar { position: sticky; bottom: 0; display: flex; gap: 10px; padding: 12px 24px; background: var(--surface); border-top: 1px solid var(--border); align-items: center; flex-wrap: wrap; }
.inspector { display: flex; flex-direction: column; }
.inspector > div:first-child { padding: 14px 16px 0; background: var(--surface-2); position: sticky; top: 0; z-index: 2; border-bottom: 1px solid var(--border); }
.inspector .tabs { overflow-x: auto; scrollbar-width: none; }
.insp-panel { padding: 18px 16px 28px; display: flex; flex-direction: column; gap: 14px; }
.insp-h { display: flex; align-items: center; gap: 7px; font-size: var(--fs-md); font-weight: 700; margin: 6px 0 2px; }

/* the document */
.doc-lead { font-size: var(--fs-lg); line-height: 1.8; color: var(--text); max-width: 68ch; }
.doc-h { font-size: var(--fs-md); font-weight: 700; color: var(--text-2); letter-spacing: .02em; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--divider); }
.quote { border-inline-start: 4px solid var(--primary-soft-2); padding: 6px 16px; color: var(--text-2); font-size: var(--fs-base); }
.bullets { padding-inline-start: 20px; display: flex; flex-direction: column; gap: 6px; }
.sections { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.sections li { display: flex; gap: 10px; align-items: center; padding: 8px 12px; background: var(--surface-2); border-radius: var(--r-sm); font-size: var(--fs-sm); }
.sec-n { width: 24px; height: 24px; border-radius: 7px; background: var(--primary-soft); color: var(--primary-text); display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; }
.swot { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@container (max-width: 620px) { .swot { grid-template-columns: minmax(0, 1fr); } }
.swot-q { border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px 16px; background: var(--surface); border-block-start: 4px solid var(--c); }
.swot-success { --c: var(--success); } .swot-danger { --c: var(--danger); } .swot-info { --c: var(--info); } .swot-attn { --c: var(--attn); }
.swot-q h4 { display: flex; align-items: center; gap: 8px; font-size: var(--fs-md); margin-bottom: 8px; }
.swot-letter { width: 24px; height: 24px; border-radius: 7px; display: inline-grid; place-items: center; color: #fff; background: var(--c); font-size: 12px; font-weight: 700; }
[data-theme="dark"] .swot-letter { color: #0b101b; }
.swot-q ul, .claims { list-style: none; display: flex; flex-direction: column; }
.claim { padding: 10px 0; border-top: 1px solid var(--divider); }
.swot-q li:first-child, .claims li:first-child { border-top: 0; padding-top: 2px; }
.claim-text { line-height: 1.6; }
.claim-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.ev-chips { display: inline-flex; gap: 4px; }
.ev-chip { min-width: 24px; height: 24px; border-radius: 12px; border: 1px solid var(--primary-soft-2); background: var(--primary-soft); color: var(--primary-text); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; padding-inline: 6px; }
.ev-chip:hover, .ev-chip.is-active { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.ev-chip.is-candidate { background: var(--attn-soft); color: var(--attn-text); border-color: var(--attn-border); border-style: dashed; }
.ev-chip.is-candidate:hover, .ev-chip.is-candidate.is-active { background: var(--attn); color: #fff; }
.ev-none { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-3); }
.recs { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.rec { display: flex; gap: 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.rec-id { width: 34px; height: 34px; border-radius: 10px; background: var(--primary-soft); color: var(--primary-text); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.prio { font-size: 12px; font-weight: 600; }
.prio-high { color: var(--danger-text); } .prio-medium { color: var(--attn-text); } .prio-low { color: var(--text-3); }
.obj-list { display: flex; flex-direction: column; gap: 10px; }
.obj { display: flex; gap: 16px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); align-items: center; }
.obj-target { text-align: end; display: flex; flex-direction: column; }
.obj-target b { font-size: var(--fs-xl); }
.obj-target span { font-size: 12px; color: var(--text-3); }

/* inspector pieces */
.ev-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px; display: flex; flex-direction: column; gap: 10px; transition: box-shadow var(--d-base), border-color var(--d-base); }
.ev-card.is-active { border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus); }
.ev-head { display: flex; gap: 10px; align-items: flex-start; }
.ev-ord { width: 24px; height: 24px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-text); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.ev-quote { border-inline-start: 3px solid var(--border-strong); padding-inline-start: 12px; color: var(--text); font-size: var(--fs-md); line-height: 1.7; }
.ev-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.gap-card { display: flex; gap: 12px; padding: 12px 14px; background: var(--attn-soft); border: 1px solid var(--attn-border); border-radius: var(--r-md); color: var(--attn-text); }
.gap-card > div { color: var(--text); }
.gap-field { display: inline-block; direction: ltr; font-family: var(--font-mono); font-size: 12px; background: var(--surface); padding: 1px 6px; border-radius: 5px; margin-bottom: 4px; color: var(--attn-text); }
.qa-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.qa-box { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); font-size: 12px; color: var(--text-3); }
.qa-box b { font-size: var(--fs-xl); color: var(--text); }
.qa-box.qa-pass svg { color: var(--success); } .qa-box.qa-warn svg { color: var(--attn); } .qa-box.qa-fail svg { color: var(--danger); }
.qa-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.qa-item { display: flex; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--divider); }
.qa-item svg { flex: none; margin-top: 2px; }
.qa-item.qa-pass svg { color: var(--success); } .qa-item.qa-warn svg { color: var(--attn); } .qa-item.qa-fail svg { color: var(--danger); }
.qa-item.qa-warn { background: var(--attn-soft); border-color: var(--attn-border); }
.qa-item.qa-fail { background: var(--danger-soft); }
.rej { padding: 12px 14px; border: 1px dashed var(--danger); border-radius: var(--r-md); background: var(--surface); display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.rej-text { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--danger) 55%, transparent); color: var(--text-2); }
.rej-reason { display: flex; gap: 6px; align-items: center; font-size: var(--fs-sm); color: var(--danger-text); font-weight: 500; }
.decision-btns { display: grid; gap: 8px; }
.check.ack { align-items: flex-start; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); }
.hist { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.hist li { display: flex; gap: 10px; }

.inspector .tabs { gap: 0; }
.inspector .tab { padding-inline: 9px; gap: 5px; flex: 1; justify-content: center; font-size: var(--fs-sm); white-space: nowrap; }
.inspector .tab svg { display: none; }
@media (max-width: 640px) {
  .keep-2 { gap: 10px; }
  .keep-2 .stat { padding: 12px 14px; }
  .keep-2 .stat-value { font-size: var(--fs-2xl); }
  .keep-2 .stat-sub { display: none; }
  .keep-2 .stat-label { font-size: var(--fs-xs); }
  .keep-2 .stat-ico { width: 28px; height: 28px; }
}

.rv-status { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
