/* Draft brain. The Draft app's workbench look: Wind Tunnel colours, Mona Sans, light only, no build step. */

@font-face { font-family: "Mona Sans"; src: url("fonts/MonaSansVF.woff2") format("woff2"); font-weight: 200 900; font-display: swap; }
@font-face { font-family: "Mona Sans Mono"; src: url("fonts/MonaSansMonoVF.woff2") format("woff2"); font-weight: 200 900; font-display: swap; }

:root {
  color-scheme: light;
  --ground: #EEF1F3;
  --paper: #FFFFFF;
  --ink: #0A0C0F;
  --muted: #545759;      /* muted */
  --rule: #d6dadd;       /* rule-soft */
  --rule-strong: #c3c8cc;   /* field-rule */
  --violet: #8B2FB0;     /* a person decides: used for what waits for a yes */
  --gilt: #b98a2e;       /* fox-gilt: needs attention (late, stale, to tidy). Marks only, never small text */
  --sans: "Mona Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "Mona Sans Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { overflow-x: clip; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 16px/1.55 var(--sans); }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; border-radius: 2px; }
h1 { font-size: clamp(28px, 3.2vw, 36px); line-height: 1.1; letter-spacing: -0.02em; font-weight: 640; margin: 0 0 6px; }
h2 { font-size: 18px; letter-spacing: -0.01em; font-weight: 620; margin: 0 0 10px; }
p { margin: 0 0 12px; max-width: 72ch; }
code, pre { font-family: var(--mono); font-size: 14px; }
.muted { color: var(--muted); }
.small { font-size: 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* the shell */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.shell.bare { display: block; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px;
        background: var(--paper); border-right: 1px solid var(--rule); padding: 20px 12px 16px; }
.side .mark { display: flex; align-items: baseline; gap: 7px; padding: 2px 10px 0; text-decoration: none; }
.side .mark img { height: 20px; display: block; align-self: center; }
.side .mark span { font-weight: 560; color: var(--muted); }
.find input { width: 100%; height: 38px; border: 1px solid var(--rule); border-radius: 6px; padding: 0 10px;
              font: inherit; background: var(--ground); color: var(--ink); }
.find input:focus { background: var(--paper); border-color: var(--rule-strong); outline: none; }
.side nav { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.side nav a { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 10px; border-radius: 6px;
              text-decoration: none; color: var(--muted); font-weight: 480; }
.side nav a:hover { background: var(--ground); color: var(--ink); }
.side nav a[aria-current="page"] { background: var(--ink); color: #fff; }
.side nav svg { flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.side .who { display: flex; flex-direction: column; gap: 2px; padding: 12px 10px 0; border-top: 1px solid var(--rule);
             font-size: 14px; color: var(--muted); min-width: 0; }
.side .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); text-decoration: underline;
              text-underline-offset: 3px; cursor: pointer; align-self: flex-start; }
button.link:hover { color: var(--ink); }
main { width: 100%; max-width: 1180px; padding: 32px clamp(16px, 3vw, 48px) 72px; }
.shell.bare main { margin: 0 auto; }

@media (max-width: 900px) {
  .shell { display: block; }
  .side { position: sticky; top: 0; z-index: 5; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center;
          gap: 8px 12px; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--rule); }
  .side .mark { padding: 0; }
  .find { flex: 1; min-width: 140px; }
  .side nav { flex-direction: row; flex-wrap: wrap; flex-basis: 100%; gap: 2px 4px; }   /* wraps, never hides a page */
  .side nav a { white-space: nowrap; min-height: 44px; min-width: 44px; justify-content: center; }
  .side nav svg { display: none; }
  .side .who { display: none; }
  main { padding: 24px 16px 56px; }
}

/* page parts */
.head { margin-bottom: 26px; }
.head .muted { margin: 0; }
.block { background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; padding: 18px 20px; margin-bottom: 16px; }
.block.wait { border-color: var(--violet); }
.block.wait h2 { color: var(--violet); }
.n { font: 560 14px var(--mono); color: var(--muted); margin-left: 4px; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { padding: 9px 0; border-top: 1px solid var(--ground); display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.rows li:first-child { border-top: 0; }
.rows.dated li { display: grid; grid-template-columns: 9.5em minmax(0, 1fr); gap: 14px; }
.rows time { font: 450 14px var(--mono); color: var(--muted); white-space: nowrap; }
.rows li.late time { color: var(--ink); font-weight: 600; }
.flag { display: inline-block; font-size: 14px; font-weight: 600; line-height: 1.4; padding: 0 6px; border-radius: 4px;
        border: 1px solid var(--gilt); background: #fff; color: var(--ink); margin-left: 6px; }
.note { color: var(--muted); font-size: 16px; }
.kind { display: inline-block; font-size: 14px; font-weight: 560; color: var(--muted); border: 1px solid var(--rule);
        border-radius: 4px; padding: 1px 6px; line-height: 1.4; white-space: nowrap; }
@media (max-width: 560px) { .rows.dated li { grid-template-columns: minmax(0, 1fr); gap: 2px; } }

.work { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.work li { background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; padding: 16px 18px; }
.work li.stale { border-left: 4px solid var(--gilt); }
.work h2 { margin-bottom: 6px; }
.work h2 a { text-decoration: none; }
.work .meta { font-size: 16px; color: var(--muted); margin: 0; }
.work li.stale .meta { color: var(--ink); }

.bigfind { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.bigfind input, .bigfind select, .mint input { height: 44px; border: 1px solid var(--rule-strong); border-radius: 6px;
       padding: 0 12px; font: inherit; background: var(--paper); color: var(--ink); }
.bigfind input { flex: 1; min-width: 220px; }
.button { display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 18px;
          border-radius: 6px; border: 0; background: var(--ink); color: #fff; font: 560 16px var(--sans);
          text-decoration: none; cursor: pointer; }
.button:hover { background: #16181c; }   /* raised */
.results { list-style: none; margin: 0; padding: 0; }
.results li { background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; padding: 12px 16px; margin-bottom: 8px; }
.results .top { margin: 0; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-weight: 520; }
.results .snip { margin: 4px 0 0; color: var(--muted); font-size: 16px; }
.tally { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tally a { display: inline-flex; gap: 6px; align-items: baseline; background: var(--paper); border: 1px solid var(--rule);
           border-radius: 6px; padding: 8px 12px; text-decoration: none; }
.tally b { font: 600 15px var(--mono); }

.crumbs { display: flex; gap: 10px; align-items: center; margin: 0 0 8px; }
.crumbs code { color: var(--muted); font-size: 14px; }
.facts { color: var(--muted); margin: 0; }
.trust.t-confirmed, .trust.t-person { color: var(--ink); }
.trust.t-migrated, .trust.t-external, .trust.t-agent { color: var(--muted); }
.trust.t-migrated::before, .trust.t-external::before, .trust.t-agent::before { content: ""; display: inline-block;
  width: 8px; height: 8px; border-radius: 50%; background: var(--gilt); margin-right: 6px; }
.fo { color: var(--violet); font-weight: 560; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
@media (max-width: 1000px) { .cols { grid-template-columns: minmax(0, 1fr); } }
.body { background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; padding: 22px 26px; min-width: 0; }
.when { font: 500 15px var(--mono); color: var(--muted); }
.periods { margin-bottom: 18px; }
.periods ul { list-style: none; padding: 0; margin: 0; }
.periods li { display: flex; flex-direction: column; padding: 6px 0; border-top: 1px solid var(--ground); }
.periods li.closed span:first-child { color: var(--muted); }
.md { overflow-wrap: anywhere; }
.md h2 { margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--rule); }
.md h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.md h3 { font-size: 16px; margin: 18px 0 6px; }
.md ul, .md ol { padding-left: 22px; margin: 0 0 12px; max-width: 76ch; }
.md li { margin-bottom: 4px; }
.md table { border-collapse: collapse; margin: 0 0 14px; font-size: 16px; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--rule); padding: 6px 8px; text-align: left; vertical-align: top; }
.md pre { background: var(--ground); padding: 12px; border-radius: 6px; overflow-x: auto; }
.md blockquote { margin: 0 0 12px; padding-left: 14px; border-left: 3px solid var(--rule); color: var(--muted); }
.src { margin: 18px 0 0; }
.links section { background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; padding: 14px 16px; margin-bottom: 12px; }
.links h2 { font-size: 16px; color: var(--muted); font-weight: 560; margin-bottom: 6px; }
.links ul { list-style: none; padding: 0; margin: 0; }
.links li { padding: 4px 0; display: flex; gap: 8px; align-items: baseline; font-size: 16px; }
.flags { border-color: var(--gilt) !important; }
.flags h2 { color: var(--ink) !important; }

.types { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.types li { background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; padding: 16px 18px; }

.fresh { background: var(--paper); border: 2px solid var(--violet); border-radius: 8px; padding: 18px 20px; margin-bottom: 16px; }
.fresh pre { background: var(--ground); padding: 10px 12px; border-radius: 6px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.mint { display: grid; gap: 10px; max-width: 560px; }
.mint label { font-weight: 520; }
.mint fieldset { border: 1px solid var(--rule); border-radius: 6px; padding: 10px 14px; display: grid; gap: 6px; margin: 0; }
.mint fieldset label { font-weight: 400; display: flex; gap: 8px; align-items: center; }
.mint input[type="checkbox"] { flex: none; width: 24px; height: 24px; accent-color: var(--ink); }
.keys { width: 100%; border-collapse: collapse; font-size: 16px; }
.keys th { text-align: left; color: var(--muted); font-weight: 520; padding: 6px 8px; border-bottom: 1px solid var(--rule); }
.keys td { padding: 8px; border-bottom: 1px solid var(--ground); }
.keys tr.off td { color: var(--muted); }
@media (max-width: 640px) { .keys thead { display: none; } .keys tr { display: grid; padding: 8px 0; border-bottom: 1px solid var(--rule); } .keys td { border: 0; padding: 2px 0; } }
.error { color: var(--ink); font-weight: 600; border-left: 4px solid var(--gilt); padding-left: 10px; }

.signin { max-width: 420px; margin: 18vh auto 0; text-align: left; }
.signin-mark { height: 26px; margin-bottom: 26px; }

.consent { max-width: 560px; margin: 10vh auto 0; background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; padding: 26px 28px; }
.consent .can { padding-left: 20px; margin: 0 0 14px; }
.choose { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 12px; }
.button.quiet { background: var(--paper); color: var(--ink); border: 1px solid var(--rule-strong); }
.button.quiet:hover { background: var(--ground); }

.questions { list-style: decimal; padding-left: 26px; margin: 0; display: grid; gap: 10px; max-width: 860px; }
.questions li { background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; padding: 12px 16px; }
.questions li::marker { font: 560 15px var(--mono); color: var(--muted); }
.questions .q { font-weight: 560; margin: 0 0 2px; }
.questions .a { margin: 0; color: var(--muted); font-size: 16px; }
.questions li.red { border-left: 4px solid var(--gilt); }
.questions li.red .a { color: var(--ink); font-weight: 520; }

mark { background: var(--ground); color: var(--ink); font-weight: 640; border-radius: 2px; }

/* Room to tap: every link and button at least 24px tall, 44px on a touch screen. Padding on an inline link
   grows its hit box without moving the text around it. */
main a, .side .who .link, button.link { padding-block: 3px; }
button.link { display: inline-flex; align-items: center; min-height: 28px; }
@media (pointer: coarse), (max-width: 900px) {
  .find input, .bigfind input, .bigfind select, .mint input, .button { min-height: 44px; }
  .side nav a { flex: none; min-height: 44px; min-width: 44px; justify-content: center; }
  .rows a, .results .top a, .links li a, .work h2 a, .types h2 a, .tally a, .crumbs a, .periods a, .facts a,
  .questions a, .keys a, button.link { display: inline-block; padding-block: 10px; min-height: 44px; }
  .md a, .snip a { padding-block: 12px; }
  .mint input[type="checkbox"] { flex: none; width: 24px; height: 24px; min-height: 0; }
  .mint fieldset label { min-height: 44px; }
}

/* long lists and untidied notes fold away, with a line saying what's inside */
details.more, details.migrated { margin-top: 10px; }
details.more summary, details.migrated summary { cursor: pointer; min-height: 32px; display: flex; align-items: center;
  font-weight: 560; color: var(--ink); }
details.migrated { border-top: 1px solid var(--rule); padding-top: 12px; margin-top: 18px; }
details.migrated summary { color: var(--muted); }
details.migrated[open] summary { margin-bottom: 10px; }
@media (pointer: coarse), (max-width: 900px) { details.more summary, details.migrated summary { min-height: 44px; } }

/* in lists the context says it's a link: underline only on hover or focus */
.rows a, .results a, .links a, .work h2 a, .types a, .tally a, .questions a, .facts a { text-decoration: none; }
.rows a:hover, .results a:hover, .links a:hover, .work h2 a:hover, .types a:hover, .tally a:hover, .questions a:hover,
.facts a:hover, .rows a:focus-visible, .results a:focus-visible, .links a:focus-visible { text-decoration: underline; }
.src { margin: 4px 0 0; }

/* the browser's own clear button on search boxes is off-brand; Escape still clears */
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

/* the graph page: drawn on the server as SVG, every node a link; a list instead on a phone */
.facts a.open { color: var(--ink); white-space: nowrap; text-decoration: underline; text-decoration-thickness: 1px; }
.way { align-items: center; }
.way label { flex-basis: 100%; font-weight: 560; }
.way input { flex: 0 1 460px; }
.graph a:focus-visible .body { stroke: #b470da; stroke-width: 4px; }    /* violet-dk: seen on the tunnel */
.graph a:focus-visible .ft, .graph a:focus-visible .fk { fill: #fff; }
.graph-list .kind { font-size: 16px; }
.way-result { background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; padding: 16px 20px; margin-bottom: 20px; }
.way-result h2 { margin-bottom: 8px; }
.steps { margin: 0; padding-left: 24px; }
.steps li { padding: 3px 0; }
.way-result p { margin: 0; }
.graph { margin: 0 0 24px; background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; padding: 12px 12px 4px; }
.graph-wrap { container-type: inline-size; }
.graph > svg { width: 100%; height: auto; display: block; font-family: var(--sans); }
/* 17.5 in the drawing's own units is 16px or more wherever the drawing shows (980px of column and up) */
.graph text { fill: var(--ink); font-size: 17.5px; }
.graph .gh { font-weight: 640; fill: var(--ink); }
.graph .ft { font-size: 24px; font-weight: 640; letter-spacing: -0.01em; fill: #fff; }
.graph .fk { font-size: 17.5px; fill: #c9ced2; text-decoration: underline; }   /* hair on the tunnel */
.graph .inf { fill: var(--muted); }
.graph .body { fill: var(--ink); }
.line { stroke: #9aa09d; stroke-width: 1.4; fill: none; }   /* smoke-2: the smoke lines */
.line.inferred { stroke-dasharray: 5 4; }
.n-person { fill: #2a4891; }                           /* fox-cobalt */
.n-company { fill: var(--ink); }
.n-record { fill: #8c9296; }                           /* muted-2 */
.n-code { fill: #fff; stroke: var(--ink); stroke-width: 1.5; }
.graph .more { fill: var(--muted); }
.graph .hit { fill: transparent; }   /* the whole row is the link: at least 24px to click or tap */
.graph a:hover text { text-decoration: underline; }
.graph a:focus { outline: none; }
.graph a:focus-visible text { fill: var(--violet); text-decoration: underline; text-decoration-thickness: 2px; }
.key { display: flex; flex-wrap: wrap; gap: 6px 20px; padding: 10px 10px 8px; color: var(--muted); font-size: 16px; }
.key span { display: inline-flex; align-items: center; gap: 8px; }
.key svg { flex: none; }
.graph-list { display: none; }
.graph-list section { background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; padding: 14px 16px; margin-bottom: 10px; }
.graph-list ul { list-style: none; margin: 0; padding: 0; }
.graph-list li { padding: 4px 0; display: flex; align-items: center; gap: 10px; }
.graph-list li a { flex: 1; }
/* On a short or narrow screen the things linked come first, and the question after them */
@media (max-width: 979px), (max-height: 500px) {
  .graph-page { display: flex; flex-direction: column; }
  .graph-page > .way { order: 3; margin-top: 12px; }
}
/* Too narrow to draw at full size (a laptop's split screen, a tablet, a phone): the same, as a list */
@container (max-width: 979px) {
  .graph { display: none; }
  .graph-list { display: block; }
  .graph-list li a { padding-block: 10px; min-height: 44px; }
}
