/* Unity SDTM: the home page. A gate's page is the skill's own; what is added to it is bridge.css. */
:root { color-scheme: light; --ai: #5b3fd6; }
* { box-sizing: border-box; }
body { margin: 0; background: #f4f4f2; color: #1a1a1a;
       font: 15px/1.55 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px 64px; }
nav.toc { position: fixed; top: 0; left: 0; bottom: 0; width: 274px; overflow-y: auto;
          background: #ebeae4; border-right: 1px solid #d2d2c8; padding: 16px 0 40px; }
nav.toc .tochead { padding: 10px 16px 9px; font-weight: 700; font-size: 12px;
                   letter-spacing: 0.09em; text-transform: uppercase; color: #6a6a60; }
nav.toc .tocfilter { width: calc(100% - 32px); margin: 0 16px 8px; padding: 6px 8px; font: inherit; font-size: 13px;
                     border: 1px solid #c8c8bc; border-radius: 3px; background: #fff; color: #1a1a1a; }
nav.toc ol { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
nav.toc li.hidden { display: none; }
nav.toc a { display: block; padding: 6px 16px 6px 15px; color: #33332e; text-decoration: none;
            border-left: 3px solid transparent; cursor: pointer; }
nav.toc a:hover { background: #e0dfd6; }
nav.toc a.current { background: #fff; border-left-color: #8a7438; font-weight: 600; }
nav.toc a .st { float: right; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: #77776c; }
nav.toc a .st.approved { color: #1d5427; } nav.toc a .st.review, nav.toc a .st.out_of_date { color: #7a4b00; }
nav.toc a .st.stopped { color: #8a1f1f; }
nav.toc .tocempty { padding: 6px 16px; color: #77776c; font-style: italic; font-size: 13.5px; }
@media (max-width: 1000px) { nav.toc { position: static; width: auto; } }
header.band { background: #fff; border-bottom: 3px solid #cfcfc8; padding: 22px 0 18px; margin-bottom: 26px; }
header.band .wrap { padding-bottom: 0; }
h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: -0.01em; }
.subtitle { color: #555; font-size: 15px; margin: 0 0 14px; }
.stamp { display: inline-block; font-weight: 700; font-size: 12px; letter-spacing: 0.09em; text-transform: uppercase;
         padding: 5px 11px; border-radius: 3px; }
.stamp.draft { background: #fdf0d5; color: #7a4b00; border: 1px solid #e8c98a; }
.stamp.approved { background: #e3f1e4; color: #1d5427; border: 1px solid #a8cfae; }
.stamp.stopped { background: #f6dede; color: #8a1f1f; border: 1px solid #dba9a9; }
.drafts { margin-left: 10px; font-size: 13px; color: #666; }
.drafts a { color: #33332e; margin-right: 6px; cursor: pointer; }
.howto { margin: 14px 0 0; padding: 12px 14px; background: #f7f7f4; border-left: 4px solid #9a9a90; font-size: 14px; max-width: 92ch; }
.howto strong { display: block; margin-bottom: 3px; }
.howto .acts { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.howto .blocking { color: #8a1f1f; margin-top: 6px; }
button, .btn { font: inherit; font-size: 13.5px; font-weight: 600; padding: 6px 14px; border-radius: 4px; cursor: pointer;
               background: #fff; color: #33332e; border: 1px solid #b9b9ad; }
button:hover { background: #efeee8; }
button.primary { background: #7a4b00; color: #fff; border-color: #5e3a00; }
button.primary:hover { background: #5e3a00; }
button.mini { font-size: 12px; padding: 2px 8px; font-weight: 600; }
button[disabled] { opacity: 0.5; cursor: default; }
nav.toc button.mini { margin: 0 16px 6px; }
.intro { font-size: 15px; margin: 0 0 26px; max-width: 78ch; }
section { margin: 0 0 34px; scroll-margin-top: 12px; }
h2 { font-size: 17px; margin: 0 0 3px; padding-bottom: 6px; border-bottom: 2px solid #d8d8d0; }
.note { color: #666; font-size: 14px; margin: 6px 0 10px; }
ul.lines { margin: 8px 0 0; padding-left: 22px; }
ul.lines li { margin-bottom: 5px; max-width: 90ch; }
.tablewrap { overflow-x: auto; background: #fff; border: 1px solid #ddd9d0; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th { position: sticky; top: 0; background: #efeee8; text-align: left; font-weight: 600; padding: 8px 10px;
     border-bottom: 2px solid #cfcfc4; white-space: nowrap; z-index: 1; }
td { padding: 7px 10px; border-bottom: 1px solid #ecece4; vertical-align: top; white-space: pre-line; }
tr:nth-child(even) td { background: #fbfbf9; }
tr:hover td { background: #fdf8e8; }
td.flag { color: #8a1f1f; font-weight: 600; }
pre.code { background: #fff; border: 1px solid #ddd9d0; padding: 12px; overflow-x: auto; font-size: 12.5px; max-height: 420px; }
.q { background: #fff; border: 1px solid #ddd9d0; padding: 12px 14px; margin: 0 0 12px; max-width: 92ch; }
.q .topic { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #6a6a60; }
.q .opts { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.q .opts button.picked { background: #e3f1e4; border-color: #a8cfae; color: #1d5427; }
.q input[type=text] { width: 60%; font: inherit; padding: 5px 8px; border: 1px solid #c8c8bc; border-radius: 3px; }
.q .given { color: #1d5427; font-size: 13.5px; }
footer.notes { margin-top: 36px; padding-top: 14px; border-top: 1px solid #d8d8d0; color: #555; font-size: 13.5px; }
footer.notes a { color: #33332e; cursor: pointer; text-decoration: underline; }
dialog { border: 1px solid #c8c8bc; border-radius: 6px; padding: 18px 20px; min-width: 420px; max-width: 640px; }
dialog h3 { margin: 0 0 10px; font-size: 17px; }
dialog label { display: block; font-size: 13px; font-weight: 600; margin: 10px 0 3px; }
dialog input[type=text], dialog textarea, dialog select { width: 100%; font: inherit; padding: 6px 8px; border: 1px solid #c8c8bc; border-radius: 3px; }
dialog .acts { margin-top: 14px; display: flex; gap: 8px; justify-content: flex-end; }
dialog .err { color: #8a1f1f; font-size: 13.5px; margin-top: 8px; }
pre.trail { white-space: pre-wrap; font-size: 12.5px; max-height: 60vh; overflow: auto; background: #f7f7f4; padding: 10px; }
@media print { body.has-toc #main { margin-left: 0; } #sdtm-toc, nav.toc, .refreshbar, .howto, .cw, .cw-open { display: none; } th { position: static; } }
.pick { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.pick select { font: inherit; padding: 4px 8px; }
.stamp.approved, .stamp.auto_passed, .stamp.settled { background: #e3f1e4; color: #1d5427; border: 1px solid #a8cfae; }
.stamp.needs_you, .stamp.sign_off, .stamp.out_of_date, .stamp.ready { background: #fdf0d5; color: #7a4b00; border: 1px solid #e8c98a; }
.stamp.blocked { background: #f6dede; color: #8a1f1f; border: 1px solid #dba9a9; }
.stamp.waiting { background: #efeee8; color: #55554c; border: 1px solid #d8d8d0; }
a.btn, label.btn { display: inline-block; text-decoration: none; color: #1a1a1a; cursor: pointer; }
.modes { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.vers { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; font-size: 13px; font-weight: 600; }
.vers label { display: flex; flex-direction: column; gap: 3px; }
.vers input { font: inherit; padding: 5px 8px; border: 1px solid #c8c8bc; border-radius: 3px; }

/* The look of the skill's gate page (assets/gate_template.html), so the home page and a gate read as one product:
   its colours, its font, white cards on a pale ground, round status pills. These rules win over the ones above. */
:root { --bg: #f6f7f9; --panel: #fff; --panel-2: #fbfbfc; --ink: #14171f; --ink-2: #3d4350; --muted: #6b7280; --line: #e4e6eb;
        --line-2: #eef0f3; --accent: #3b5bdb; --accent-soft: #eef2ff; --ask: #c2410c; --ask-soft: #fff3eb; --ask-line: #fdd5bd;
        --ok: #15803d; --ok-soft: #e8f6ed; --bad: #b91c1c; --bad-soft: #fdecec; --rule: #475569; --rule-soft: #f1f3f6;
        --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06); }
body { background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased;
       font: 14px/1.55 "Segoe UI Variable Text", "Segoe UI", Inter, system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif; }
a { color: var(--accent); }
.wrap { max-width: 1280px; }
header.band { background: var(--panel); border-bottom: 1px solid var(--line); padding: 18px 0 16px; margin-bottom: 24px; }
h1 { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 700; letter-spacing: -0.015em; }
h1::before { content: "SD"; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff;
             font-size: 12.5px; font-weight: 700; letter-spacing: 0; background: linear-gradient(135deg, var(--accent), #8b5cf6); }
.subtitle, .note { color: var(--muted); }
.subtitle { font-size: 14px; }
.intro { font-size: 14.5px; color: var(--ink-2); margin-bottom: 20px; }
section { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
          padding: 16px 18px 18px; margin-bottom: 18px; }
h2 { font-size: 15.5px; font-weight: 650; border-bottom: 0; padding-bottom: 0; }
.note { font-size: 13px; margin: 4px 0 12px; }
button, .btn, a.btn, label.btn { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 8px;
                                 padding: 6px 12px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
button:hover, .btn:hover { background: var(--panel-2); border-color: #cfd3da; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover, .btn.primary:hover { background: #3451c6; }
button.mini { font-size: 12px; padding: 3px 9px; border-radius: 7px; }
select, input[type=text], textarea, .vers input, dialog input[type=text], dialog textarea, dialog select {
  font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; }
select:focus, input:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
input[type=radio] { accent-color: var(--accent); }
.tablewrap { border: 1px solid var(--line); border-radius: 10px; }
table { font-size: 13px; }
th { background: var(--panel-2); color: var(--ink-2); font-weight: 650; padding: 8px 12px; border-bottom: 1px solid var(--line); }
td { padding: 8px 12px; border-bottom: 1px solid var(--line-2); }
tr:nth-child(even) td { background: transparent; }
tr:hover td { background: var(--accent-soft); }
.stamp { border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none;
         white-space: nowrap; }
.stamp.approved, .stamp.auto_passed, .stamp.settled { background: var(--ok-soft); color: var(--ok); border: 1px solid transparent; }
.stamp.needs_you, .stamp.sign_off, .stamp.out_of_date, .stamp.ready { background: var(--ask-soft); color: var(--ask);
                                                                     border: 1px solid var(--ask-line); }
.stamp.blocked { background: var(--bad-soft); color: var(--bad); border: 1px solid transparent; }
.stamp.waiting { background: var(--rule-soft); color: var(--rule); border: 1px solid transparent; }
.modes label, label.radio { display: flex; gap: 8px; align-items: baseline; }
footer.notes { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
footer.notes a { color: var(--accent); }
dialog { border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(16,24,40,.12); color: var(--ink); }
dialog::backdrop { background: rgba(16,24,40,.35); }
dialog .err { color: var(--bad); }
.pick[hidden] { display: none; }
/* The gate a job is running: its Status cell says so live, with the AI's mark turning (the owner, 2026-12-04) */
.gate-live { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: #5b3fd6; }
.ai-spin { display: inline-block; animation: ai-spin 1.2s linear infinite; }
@keyframes ai-spin { to { transform: rotate(360deg); } }
.gate-now { display: inline-block; width: 280px; max-width: 100%; min-height: 1.4em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
[data-live-gate]:not(:empty) + .gate-was { display: none; }

/* a gate's row opens the gate */
tr.gate-row { cursor: pointer; }

.dl-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
a.btn.primary { background: #7a4b00; color: #fff; border-color: #5e3a00; }
a.btn.primary:hover { background: #5e3a00; }

/* every section folds by its heading */
section.fold > h2.fold-h { cursor: pointer; user-select: none; display: flex; align-items: center; gap: 8px; }
section.fold > h2.fold-h:focus-visible { outline: 2px solid var(--accent, #3b5bdb); outline-offset: 2px; }
.fold-caret { display: inline-block; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-top: 7px solid currentColor; opacity: .55; transition: transform .15s; flex: none; }
section.fold.shut .fold-caret { transform: rotate(-90deg); }
section.fold.shut > .fold-body { display: none; }
section.fold.shut > h2.fold-h { margin-bottom: 0; }

/* the contents at the left: narrow, and the page uses the width beside it */
#sdtm-toc { position: fixed; left: var(--toc-left, 0px); top: 0; bottom: 0; width: 168px; padding: 8px 6px 8px 0; overflow-y: auto; z-index: 20;
  background: var(--panel, #fff); border-right: 1px solid var(--line, #ddd); font-size: 13px; transition: width .15s; }
#sdtm-toc .toc-btn { display: flex; align-items: center; gap: 6px; width: 100%; padding: 5px 0; background: none; border: 0;
  color: inherit; font-weight: 650; cursor: pointer; border-radius: 6px; }
#sdtm-toc .toc-btn:hover { background: var(--panel-2, #f3f3f0); }
#sdtm-toc ol { list-style: none; margin: 4px 0 0; padding: 0; }
#sdtm-toc li a { display: block; padding: 4px 8px 4px 12px; border-radius: 6px; color: inherit; text-decoration: none;
  border-left: 3px solid transparent; }
#sdtm-toc li a:hover { background: var(--panel-2, #f3f3f0); }
#sdtm-toc li a.on { border-left-color: var(--accent, #3b5bdb); font-weight: 600; }
body.has-toc #main { margin-left: calc(var(--toc-left, 0px) + 168px); margin-right: 0; max-width: none; padding-left: 20px; padding-right: 20px; }
body.has-toc.toc-shut #sdtm-toc { width: 40px; }
body.has-toc.toc-shut #sdtm-toc ol, body.has-toc.toc-shut #sdtm-toc .toc-title { display: none; }
body.has-toc.toc-shut #main { margin-left: calc(var(--toc-left, 0px) + 40px); }
