/* Unity SDTM's additions to the skill's gate page: one bar, the job line and the SDTM AI Coworker. */
body.sdtm-has-bar { padding-top: 0; }
.sdtm-bar { position: sticky; top: 0; z-index: 55; display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
            padding: 8px 18px; background: #23232b; color: #f2f2f2; font: 13.5px/1.4 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.sdtm-bar a { color: #cfd4ff; text-decoration: none; font-weight: 600; }
.sdtm-bar label { display: flex; gap: 6px; align-items: center; }
.sdtm-bar select { font: inherit; }
.sdtm-grow { flex: 1; }
.sdtm-st { padding: 2px 9px; border-radius: 10px; font-weight: 700; font-size: 12px; background: #55556a; }
.sdtm-st.approved, .sdtm-st.auto_passed, .sdtm-st.settled { background: #1f6b34; }
.sdtm-st.needs_you, .sdtm-st.sign_off, .sdtm-st.out_of_date { background: #8a5a00; }
.sdtm-st.blocked { background: #8a1f1f; }
.sdtm-note { padding: 9px 18px; background: #f6dede; color: #8a1f1f; font: 600 13.5px/1.5 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.sdtm-btn { font: 600 13px/1.2 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; padding: 5px 12px; border: 1px solid #b9b9ad;
            border-radius: 4px; background: #fff; color: #1a1a1a; cursor: pointer; }
.sdtm-btn.primary { background: #5b3fd6; border-color: #4a31b8; color: #fff; }
.sdtm-job { position: fixed; left: 18px; bottom: 18px; z-index: 80; display: flex; align-items: center; gap: 10px; max-width: 620px;
            padding: 8px 10px 8px 14px; background: #fdf0d5; color: #7a4b00; border: 1px solid #e8c98a; border-radius: 6px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.2); font: 600 13px/1.4 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.sdtm-job.bad { background: #f6dede; color: #8a1f1f; border-color: #dba9a9; }
.sdtm-job[hidden] { display: none; }
.sdtm-job.sj { display: block; width: 560px; max-width: calc(100vw - 36px); max-height: 60vh; overflow: auto; font-weight: 400; }
.sdtm-job.sj[hidden] { display: none; }  /* after .sj's display: block, or Close on a job panel hides nothing */
.sdtm-job.ok { background: #e4f3e6; color: #1f5a2a; border-color: #a9d3b0; }
.sj-head { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.sj-btns { margin-left: auto; display: flex; gap: 6px; }
.sj-state { padding: 1px 8px; border-radius: 10px; font-size: 12px; background: rgba(0,0,0,0.08); }
.sj-time { font-variant-numeric: tabular-nums; }
.sj-gate { margin: 6px 0 0; font-weight: 700; }
.sj-now { margin: 2px 0 2px; font-weight: 600; overflow-wrap: anywhere; }
.sj-bar { height: 6px; background: rgba(0,0,0,0.1); border-radius: 3px; overflow: hidden; margin: 4px 0 6px; }
.sj-bar i { display: block; height: 100%; background: #5b3fd6; transition: width .4s; }
.sj-ai { box-sizing: border-box; height: 96px; overflow: hidden; margin: 6px 0; padding: 6px 8px; background: rgba(255,255,255,0.6); border-radius: 4px; }
.sj-ai-head { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sj-tail { margin-top: 4px; height: 4.5em; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; white-space: pre-wrap; font: 12px/1.5 ui-monospace, Menlo, monospace; color: #444; }
.sj-err { margin: 6px 0; font-weight: 600; }
.sdtm-job details { margin-top: 6px; }
.sj-steps { margin: 4px 0; padding-left: 20px; font-size: 12px; }
.sj-steps li span:last-child { margin-left: 8px; }
.cw-open { position: fixed; right: 18px; bottom: 84px; z-index: 60; background: #5b3fd6; color: #fff; border: 1px solid #4a31b8;
           border-radius: 18px; padding: 8px 16px; font: 600 13.5px/1.2 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; cursor: pointer; }
.cw-open[hidden] { display: none; }
/* the panel is a drawer on the right, full height, as Unity's and SAP's AI panel; the page makes room for it */
.cw { position: fixed; top: 0; right: 0; bottom: 0; z-index: 90; width: 420px; max-width: 100vw;
      display: flex; flex-direction: column; background: #fff; color: #1a1a1a; border: 0; border-left: 1px solid #c8c8bc;
      border-top: 3px solid #5b3fd6; box-shadow: -8px 0 24px rgba(0,0,0,0.08);
      font: 14px/1.5 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
body.cw-on { padding-right: 420px; }
@media (max-width: 900px) { body.cw-on { padding-right: 0; } }
.cw-open.in-page { position: static; flex: none; }
.cw[hidden] { display: none; }
.cw-head { padding: 10px 12px; border-bottom: 1px solid #ecece4; display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; }
.cw-head .note { grid-column: 1; margin: 0; font-size: 12.5px; color: #666; }
.cw-head button { grid-row: 1 / span 2; grid-column: 2; align-self: start; }
.cw-turns { flex: 1; overflow-y: auto; padding: 10px 12px; }
.cw-turns .me { margin: 10px 0 4px; font-weight: 600; }
.cw-turns .ai { white-space: pre-wrap; border-left: 3px solid #5b3fd6; padding-left: 9px; }
.cw-turns .meta { color: #77776c; font-size: 12px; margin-top: 3px; }
.cw form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid #ecece4; }
.cw textarea { flex: 1; font: inherit; padding: 6px 8px; border: 1px solid #c8c8bc; border-radius: 3px; resize: none; }
h1:has(> #sb-run) { display: flex; align-items: center; gap: 8px; }
h1 > #sb-run { margin-left: auto; }  /* Run Gate N, written in the gate's heading at its right */
/* Approve Gate, at the right of Run Gate N; both Approve buttons dimmed while the gate is not Ready for Sign-Off */
#sb-approve:disabled, #approveBtn:disabled { opacity: .45; cursor: not-allowed; }
/* after Approve: the gate is approved; run the next one? */
.sb-next { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.sb-next-card { background: #fff; border-radius: 8px; padding: 18px 20px; max-width: 420px; box-shadow: 0 8px 30px rgba(0,0,0,.25); }
.sb-next-card p { margin: 8px 0 14px; }
.sb-next-acts { display: flex; gap: 8px; justify-content: flex-end; }
.sdtm-job.wait { background: #fffbeb; border: 2px solid #f59e0b; }
.sdtm-job.wait .sj-ask { background: #fef3c7; color: #78350f; padding: 8px 10px; font-weight: 600; }
.sdtm-note-head { margin-top: .4em; }
.sdtm-note-list { margin: .2em 0 0 1.2em; padding: 0; }
.sdtm-docs summary { cursor: pointer; }
.sdtm-docs-t { border-collapse: collapse; margin-top: .4em; font-size: 13px; }
.sdtm-docs-t th, .sdtm-docs-t td { border-bottom: 1px solid rgba(0,0,0,.08); padding: 3px 10px 3px 0; text-align: left; }
.du-ok { color: #15803d; } .du-bad { color: #b91c1c; font-weight: 600; }
.du-foot { margin-top: .3em; font-size: 12px; opacity: .75; }
.sdtm-note.sdtm-docs { background: #f4f6f8; color: #1f2937; font-weight: 400; }
:root[data-theme="dark"] .sdtm-note.sdtm-docs { background: #1f2630; color: #e5e7eb; }
/* Documents Used and Contents under the gate's heading; the gate's summary at the bottom of the page */
.hero > .sdtm-docs { margin: 10px 0 0; border-radius: 8px; }
.sdtm-toc ol { margin: .3em 0 0 1.3em; padding: 0; } .sdtm-toc ol ol { margin-top: 0; columns: 4 220px; column-gap: 28px; }  /* a long record's sections side by side */
.sdtm-toc a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.sdtm-toc-acts { display: flex; gap: 8px; margin-top: .5em; }
.sdtm-foot { margin-top: 18px; margin-bottom: 150px; scroll-margin-top: 110px; }  /* clear of the fixed action bar */
#sdtm-docs, .sdtm-toc { scroll-margin-top: 110px; }
body.sdtm-has-foot .panel { padding-bottom: 22px; }
/* a section folds by a click on its heading */
section.rec > header, .cardbox > h3 { cursor: pointer; }
section.rec > header h2::before, .cardbox > h3::before { content: "▾"; display: inline-block; width: 1.1em; opacity: .6; }
section.rec.sdtm-shut > header h2::before, .cardbox.sdtm-shut > h3::before { content: "▸"; }
section.rec.sdtm-shut > :not(header), .cardbox.sdtm-shut > :not(h3) { display: none; }
