/* Look: a plain SharePoint list. White page, system font, thin grey lines, one blue for what is
   selected or clickable, and four soft tints for status. Every colour is set once, here. */
:root {
  --ink: #242424; --soft: #616161; --faint: #9e9e9e; --line: #e3e3e3; --edge: #d1d1d1;
  --page: #fff; --card: #fff; --hover: #f5f5f5; --grey-bg: #f0f0f0;
  --accent: #0f6cbd; --accent-deep: #115ea3; --accent-bg: #ebf3fc; --accent-edge: #b4d6fa;
  --key: #a4262c; --key-bg: #fdeceb;
  --ok: #1b6b4a; --ok-bg: #e3f2ea;
  --wait: #6b5310; --wait-bg: #f8eed5;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 400 15px/1.45 "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif; color: var(--ink); background: var(--page); -webkit-font-smoothing: antialiased; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1 { font-size: 26px; font-weight: 600; line-height: 1.2; margin: 0; }
h2 { font-size: 18px; font-weight: 600; line-height: 1.3; margin: 0 0 12px; }
a { color: var(--accent-deep); }
button, input, select, textarea { font: inherit; color: inherit; }
.grow { flex: 1; }
.muted { color: var(--soft); }
.eyebrow { display: block; font-size: 14px; color: var(--soft); }
label { display: block; font-size: 14px; font-weight: 600; margin: 16px 0 5px; }
.err { color: var(--key); margin-top: 10px; min-height: 1.4em; }
.ic { fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* buttons */
button { cursor: pointer; display: inline-flex; align-items: center; gap: 7px; border-radius: 4px; border: 1px solid var(--edge); background: #fff; padding: 6px 13px; color: var(--ink); font-weight: 400; }
button:hover { background: var(--hover); border-color: #c2c2c2; }
button.main { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.main:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
button.cmd { border: 0; background: none; padding: 7px 10px; }
button.cmd:hover { background: var(--hover); }
button.cmd .ic { color: var(--accent); }
button.cmd.danger, button.cmd.danger .ic { color: var(--key); }
button.link { border: 0; background: none; padding: 4px 0; color: var(--soft); border-radius: 0; }
button.link:hover { background: none; color: var(--accent-deep); }
button.icon { border: 0; background: none; padding: 5px; color: var(--soft); }
button.icon:hover { background: var(--hover); }
button:disabled { opacity: 0.55; cursor: default; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=search], input[type=date], textarea, select {
  width: 100%; padding: 7px 10px; border: 1px solid var(--edge); border-radius: 4px; background: #fff; }
input:hover, textarea:hover, select:hover { border-color: #a8a8a8; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: inset 0 -1px 0 var(--accent); }
textarea { resize: vertical; min-height: 96px; }
textarea.small { min-height: 66px; }
/* a text box in the pane grows with what is written in it */
.detail textarea { field-sizing: content; max-height: 320px; }

/* top: one bar with the logo and the name of the tool, then the two pages */
.wrap { padding: 0 28px; display: flex; align-items: center; gap: 20px; }
.strip { border-bottom: 1px solid var(--line); font-size: 14px; }
.strip .wrap { min-height: 48px; }
.logo { display: flex; align-items: center; gap: 9px; }
.logo .mark { height: 26px; width: auto; }
.logo .word { height: 10px; width: auto; }
.strip .app { font-size: 16px; font-weight: 600; border-left: 1px solid var(--line); padding-left: 20px; }
.strip .who { color: var(--soft); }
.nav { border-bottom: 1px solid var(--line); font-size: 14px; }
.nav .wrap { min-height: 40px; gap: 24px; }
.nav a { color: var(--soft); text-decoration: none; padding: 9px 0 8px; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--ink); }
.nav a.here { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }

.page { padding: 22px 28px 40px; }
.crumbs { font-size: 14px; color: var(--soft); display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.crumbs a { color: var(--soft); text-decoration: none; }
.crumbs a:hover { color: var(--accent-deep); text-decoration: underline; }
.head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
/* what needs doing, as numbers that open their list */
.sum { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.sum:empty { display: none; }
button.sumitem { border-radius: 6px; padding: 6px 14px; }
button.sumitem b { font-weight: 600; }

/* sign in */
.sign { max-width: 400px; margin: 9vh auto 0; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 32px 32px 28px; text-align: center; }
.sign form { text-align: left; margin-top: 8px; }
.sign .mark { height: 56px; }
.sign .word { height: 12px; display: block; margin: 12px auto 18px; }
.sign h1 { font-size: 22px; }
.sign button.main { margin-top: 14px; width: 100%; justify-content: center; padding: 9px; }

/* case cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 18px; }
.cards a { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; text-decoration: none; color: var(--ink); }
.cards a:hover { border-color: var(--accent); }
.cards h2 { margin: 6px 0 12px; }
.cards .go { color: var(--accent-deep); font-size: 14px; }
.empty { padding: 60px 20px; text-align: center; color: var(--soft); }

/* views as a pivot, then the command bar */
.pivot { display: flex; gap: 24px; margin-top: 14px; border-bottom: 1px solid var(--line); }
.pivot button { border: 0; border-radius: 0; padding: 9px 0 8px; background: none; color: var(--soft); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.pivot button:hover { color: var(--ink); background: none; }
.pivot button.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }
.bar { display: flex; align-items: center; gap: 4px; padding: 8px 0; flex-wrap: wrap; }
.bar .sep { width: 1px; height: 22px; background: var(--line); margin: 0 8px; }
.chip { border-radius: 999px; padding: 4px 14px; margin-right: 4px; }
.chip.on { background: var(--accent-bg); border-color: var(--accent-edge); color: var(--accent-deep); }
.search { position: relative; }
.search .ic { position: absolute; left: 10px; top: 50%; margin-top: -8px; color: var(--soft); }
.search input { width: 210px; padding-left: 32px; }

.work { display: flex; gap: 16px; align-items: flex-start; }
.mainpane { flex: 1; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: auto; min-height: 420px; max-height: calc(100vh - 256px); position: relative; }
.detail { width: 410px; flex: none; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 20px 20px; max-height: calc(100vh - 256px); overflow: auto; }
.detail[hidden] { display: none; }
.detail .err { position: sticky; top: -16px; z-index: 2; margin: 6px -8px 0; padding: 8px; border-radius: 6px; background: var(--key-bg); min-height: 0; }
.detail .err:empty { display: none; }
.detail .row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.detail .panehead { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.detail .panehead .eyebrow { flex: 1; }
.detail .title { font-size: 20px; font-weight: 600; line-height: 1.3; }
.detail textarea.title { border-color: transparent; background: transparent; padding: 4px 6px; margin-left: -6px; min-height: 0; resize: none; overflow: hidden; field-sizing: content; }
.detail textarea.title:hover, .detail textarea.title:focus { border-color: var(--edge); background: #fff; }
.seg { display: inline-flex; border: 1px solid var(--edge); border-radius: 4px; overflow: hidden; margin-right: 10px; }
.seg button { border: 0; border-radius: 0; padding: 6px 13px; border-left: 1px solid var(--line); }
.seg button:first-child { border-left: 0; }
.seg button.on { background: var(--accent); color: #fff; font-weight: 600; }
.refs { margin: 0 0 10px; padding: 0; list-style: none; }
.refs li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.refs li > .ic { color: var(--accent); }
.refs li span.size { color: var(--faint); font-size: 13px; }
.actions { display: flex; gap: 2px; flex-wrap: wrap; align-items: center; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.actions select { width: auto; flex: 1; min-width: 120px; }
.changed { font-size: 13px; color: var(--soft); margin-top: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.detail .ro { white-space: pre-wrap; }
.hint { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--accent-bg); border-radius: 6px; padding: 8px 12px; margin-top: 10px; }
.refs li.ck { display: block; padding: 9px 0; }
.refs li.ck .row { margin-top: 6px; }
.refs + .row, .refs + select { margin-top: 2px; }
button.text { display: block; border: 0; border-radius: 0; padding: 0; background: none; text-align: left; line-height: 1.45; }
button.text:hover { background: none; color: var(--accent-deep); text-decoration: underline; }
select.res { width: auto; padding: 4px 6px; font-size: 14px; }
.nowrap { white-space: nowrap; }
.late { color: var(--key); }

/* status as a pill, the way a SharePoint choice column shows it: four soft tints and no more */
.pill { display: inline-block; padding: 3px 12px; border-radius: 10px; font-size: 14px; white-space: nowrap; background: var(--ok-bg); color: var(--ok); border: 1px solid transparent; }
.pill.key { background: var(--key-bg); color: var(--key); }
.pill.less, .pill.out, .pill.res-weakens, .pill.res-rulesout, .pill.res-none { background: var(--grey-bg); color: var(--soft); }
.pill.step-toask, .pill.step-asked { background: var(--wait-bg); color: var(--wait); }
.pill + .pill { margin-left: 6px; }
/* the same pills as buttons, in the pane: the chosen one keeps its tint, the others are plain */
button.pill { cursor: pointer; padding: 5px 13px; }
button.pill:not(.on) { background: #fff; border-color: var(--edge); color: var(--soft); }
button.pill.on { border-color: currentColor; }

/* mind map: a tree that grows to both sides */
.tree { padding: 22px; display: inline-flex; align-items: center; width: max-content; }
.tree ul { list-style: none; margin: 0; padding: 0; }
.kids { display: flex; flex-direction: column; margin-left: 40px; position: relative; }
.kids > li { display: flex; align-items: center; position: relative; padding: 5px 0; }
.kids > li::before { content: ""; position: absolute; left: -20px; top: 50%; width: 20px; border-top: 1.5px solid var(--edge); }
.kids > li::after { content: ""; position: absolute; left: -20px; top: 0; height: 100%; border-left: 1.5px solid var(--edge); }
.kids > li:first-child::after { top: 50%; height: 50%; }
.kids > li:last-child::after { height: 50%; }
.kids > li:only-child::after { display: none; }
.node { position: relative; display: flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--edge); border-radius: 6px; background: #fff;
  cursor: pointer; flex: none; width: max-content; max-width: 300px; line-height: 1.35; }
.node:hover { border-color: var(--accent); }
.has-kids > .node::after, .rootnode.to-right::after { content: ""; position: absolute; right: -21px; top: 50%; width: 20px; border-top: 1.5px solid var(--edge); }
.rootnode.to-left::before { content: ""; position: absolute; left: -21px; top: 50%; width: 20px; border-top: 1.5px solid var(--edge); }
/* the left half of the map is the same tree, mirrored */
.kids.left, .kids.left .kids { margin-left: 0; margin-right: 40px; align-items: flex-end; }
.kids.left li { flex-direction: row-reverse; }
.kids.left li::before { left: auto; right: -20px; }
.kids.left li::after { left: auto; right: -20px; border-left: 0; border-right: 1.5px solid var(--edge); }
.kids.left .has-kids > .node::after { right: auto; left: -21px; }
.node.branch { font-weight: 600; background: var(--grey-bg); border-color: transparent; }
.node.rootnode { font-size: 17px; font-weight: 600; line-height: 1.3; background: var(--accent); color: #fff; border-color: var(--accent); cursor: default; max-width: 240px; text-align: center; flex: none; padding: 12px 16px; }
.node.sel { outline: 2.5px solid var(--accent); outline-offset: 1px; }
.node .rank, .rankdot { font-size: 13px; min-width: 22px; height: 22px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; background: var(--grey-bg); color: var(--ink); flex: none; }
.rankdot { min-width: 30px; height: 30px; border-radius: 15px; font-size: 14px; }
.node .count { font-size: 13px; font-weight: 400; color: var(--soft); }
.node .caret { border: 0; background: none; padding: 0 4px; color: var(--soft); font-size: 17px; line-height: 1; }
.st-key { color: var(--key); }
.st-less { color: var(--soft); }
.st-out { color: var(--faint); text-decoration: line-through; }
.node.st-key { border-color: #e9b9b5; background: var(--key-bg); }
.node.st-key .rank { background: #fff; }

/* the table view: a label, then a list in a card, twice */
.work.flow { align-items: flex-start; }
.mainpane.flat { background: none; border: 0; border-radius: 0; overflow: visible; min-height: 0; max-height: none; }
.work.flow .detail { position: sticky; top: 12px; max-height: calc(100vh - 24px); }
.seclabel { color: var(--soft); margin: 12px 2px 8px; }
.seclabel + .chips { margin-top: -2px; }
/* the name of a failure, over its own table */
.seclabel.part { color: var(--ink); font-size: 18px; font-weight: 600; margin-top: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px 2px; margin: 0 0 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; margin-bottom: 18px; }
.card table.list th { position: static; background: none; }

/* why tree: a question, its answers in rows, and under each answer the next question */
.card.why { overflow: hidden; }
.whead { padding: 14px 18px 14px; cursor: pointer; }
.whead:hover { background: var(--hover); }
.whead.rowsel { background: var(--accent-bg); box-shadow: inset 3px 0 0 var(--accent); }
.wline { display: flex; align-items: center; gap: 12px; }
.wtitle { font-size: 20px; font-weight: 600; line-height: 1.3; margin-top: 2px; }
.wrow { display: flex; align-items: flex-start; gap: 16px; padding: 11px 18px; border-top: 1px solid var(--line); cursor: pointer; }
.wrow:hover { background: var(--hover); }
.wrow.rowsel { background: var(--accent-bg); box-shadow: inset 3px 0 0 var(--accent); }
.wrow .w-t { flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: 6px; padding-left: calc(var(--d, 0) * 30px); }
.wrow .w-name { min-width: 0; }
.wrow .fold { flex: none; width: 24px; height: 24px; padding: 0; border: 0; background: none; color: var(--soft); display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; }
.wrow button.fold:hover { background: var(--grey-bg); color: var(--ink); }
.wrow .w-st { width: 130px; flex: none; }
.wrow .w-ck { width: 100px; flex: none; }
.wrow .w-wait { width: 130px; flex: none; }
.wrow .w-n { width: 392px; flex: none; }
.wrow .under { font-size: 14px; color: var(--soft); margin-top: 2px; }
.wrow.wlabels, .wrow.wq, .wrow.wadd { cursor: default; }
.wrow.wlabels:hover, .wrow.wq:hover, .wrow.wadd:hover { background: none; }
.wrow.wlabels { color: var(--soft); padding-top: 9px; padding-bottom: 9px; }
.wrow.wq .q { font-weight: 600; }
.wrow.wq .q.muted, .wtitle .q.muted { font-weight: 400; }
.wrow.wadd { border-top: 0; padding-top: 0; padding-bottom: 10px; }
.wrow.wadd button, .wrow .askwhy { color: var(--accent-deep); }
.wrow .askwhy { flex: none; margin-left: 10px; visibility: hidden; }
.wrow:hover .askwhy, .wrow.rowsel .askwhy { visibility: visible; }

/* table: a SharePoint list */
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; color: var(--soft); font-weight: 400; padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; white-space: nowrap;
  position: sticky; top: 0; background: var(--card); z-index: 1; }
table.list th:hover { color: var(--ink); background: var(--hover); }
table.list > tbody > tr > td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list > tbody > tr:last-child > td { border-bottom: 0; }
table.list > tbody > tr { cursor: pointer; }
table.list > tbody > tr:hover > td { background: var(--hover); }
table.list > tbody > tr.rowsel > td { background: var(--accent-bg); }
table.list > tbody > tr.rowsel > td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
table.list td.name { font-weight: 600; }
table.list td.q { min-width: 240px; }
table.list td.c-rank { width: 64px; padding-top: 9px; padding-bottom: 9px; }
table.list .under { font-size: 14px; font-weight: 400; color: var(--soft); margin-top: 2px; white-space: normal; }
table.list .under.late { color: var(--key); }
/* a cause unfolded: what would settle it, and its checks */
table.list > tbody > tr.isopen > td { border-bottom-color: transparent; }
table.list > tbody > tr.sub, table.list > tbody > tr.sub:hover > td { cursor: default; background: none; }
table.list > tbody > tr.sub > td { padding-top: 0; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.facts { display: grid; grid-template-columns: max-content 1fr 1fr 1fr; gap: 8px 32px; margin: 2px 0 12px; }
.facts p { margin: 3px 0 0; white-space: pre-wrap; }
table.sublist { width: 100%; border-collapse: separate; border-spacing: 0; margin: 0 0 6px; background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
table.sublist td { padding: 9px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.sublist tr:last-child td { border-bottom: 0; }
table.sublist tr { cursor: pointer; }
table.sublist tr:hover td { background: var(--hover); }
table.sublist tr.rowsel td { background: var(--accent-bg); }

/* fishbone */
.fish { padding: 10px; }
.fish svg { display: block; height: auto; }
.fish text { font-size: 14px; fill: var(--ink); cursor: pointer; }
.fish text.cat { font-size: 15px; font-weight: 600; cursor: pointer; }
.fish text.head { font-size: 18px; font-weight: 600; fill: #fff; cursor: default; }
.fish .pick { cursor: pointer; }
.fish text.st-key { fill: var(--key); }
.fish text.st-less { fill: var(--soft); }
.fish text.st-out { fill: var(--faint); text-decoration: line-through; }
.fish text.sel { text-decoration: underline; text-decoration-thickness: 2px; fill: var(--accent); }
.fish .bone { stroke: #707070; stroke-width: 1.6; fill: none; }
.fish .spine { stroke: var(--ink); stroke-width: 2.4; fill: none; }
.fish .headbox { fill: var(--accent); stroke: var(--accent); }
.fish .arrow { fill: var(--ink); }

/* users */
table.users select { width: auto; }
table.users td, table.users th { white-space: nowrap; vertical-align: middle; }
table.users tbody tr, table.users th { cursor: default; }

dialog { border: 1px solid var(--line); border-radius: 8px; padding: 24px 26px; width: min(460px, 92vw); background: var(--card); color: var(--ink); box-shadow: 0 8px 32px rgb(0 0 0 / 0.14); }
dialog::backdrop { background: rgb(0 0 0 / 0.4); }
dialog .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

@media (max-width: 900px) {
  .work { flex-direction: column; }
  .detail { width: 100%; }
  .mainpane, .detail { max-height: none; }
  .strip .app, .strip .who { display: none; }
  .facts { grid-template-columns: 1fr; }
  .work.flow .detail { position: static; max-height: none; }
}

/* With the pane open on a smaller screen, the checks list drops the evidence column. */
@media (max-width: 1400px) {
  .split table.list .c-ev { display: none; }
  .split .wrow .w-wait { display: none; }
  .split .wrow .w-n { width: 246px; }
}
@media (max-width: 900px) {
  .wrow .w-ck, .wrow .w-wait { display: none; }
  .wrow .w-n { width: 130px; }
  .wrow .w-t { padding-left: calc(var(--d, 0) * 16px); }
}
