/* Rubedo. Colors come from the shop floor: cabinet grey, frame anthracite, gentian blue, signal yellow. */

@font-face { font-family: "Public Sans"; src: url("fonts/public-sans-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "B612 Mono"; src: url("fonts/b612-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "B612 Mono"; src: url("fonts/b612-mono-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --cabinet: #E8EAE7;
  --cabinet-deep: #DBDEDA;
  --panel: #FFFFFF;
  --frame: #2E353A;
  --frame-lit: #3D464C;
  --ink: #1D2226;
  --muted: #58626A;
  --line: #C3C9C6;
  --line-soft: #E0E4E2;
  --blue: #0F4C8A;
  --blue-deep: #0A3966;
  --signal: #F0B400;
  --green: #0B6E45;
  --red: #A8231C;
  --text: "Public Sans", "Segoe UI", Arial, sans-serif;
  --code: "B612 Mono", "Consolas", monospace;
}

* { box-sizing: border-box; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--cabinet); color: var(--ink); font-family: var(--text); line-height: 1.45; font-variant-numeric: tabular-nums; }
h1, h2, h3, p, ul, ol, dl, dd, figure, fieldset { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
a { color: var(--blue); text-underline-offset: 2px; }
a:hover { color: var(--blue-deep); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.js .js-hide { display: none; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- frame */

.shell { display: grid; grid-template-columns: 204px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--frame); color: #D4D9DC; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: block; padding: 20px 20px 18px; color: #fff; text-decoration: none; border-bottom: 1px solid var(--frame-lit); }
.brand-name { display: block; font-size: 1.35rem; font-weight: 700; letter-spacing: .01em; }
.brand-org { display: block; font-size: .82rem; color: #A9B2B8; margin-top: 1px; }
.side ul { padding: 12px 0; flex: 1; }
.side li a { display: flex; align-items: center; justify-content: space-between; padding: 9px 20px 9px 17px; color: #D4D9DC; text-decoration: none; border-left: 3px solid transparent; font-weight: 500; }
.side li a:hover { background: var(--frame-lit); color: #fff; }
.side li a[aria-current] { background: var(--frame-lit); color: #fff; border-left-color: var(--signal); }
.count { background: var(--signal); color: var(--ink); font-size: .78rem; font-weight: 700; min-width: 22px; text-align: center; padding: 1px 6px; border-radius: 2px; }
.who { padding: 14px 20px 18px; border-top: 1px solid var(--frame-lit); font-size: .87rem; }
.who-name { display: block; color: #fff; font-weight: 600; overflow-wrap: anywhere; }
.who-role { display: block; color: #A9B2B8; margin-bottom: 6px; }
.as-link { background: none; border: 0; padding: 0; font: inherit; color: #D4D9DC; text-decoration: underline; cursor: pointer; }
.as-link:hover { color: #fff; }

.main { min-width: 0; }
.top { padding: 14px 28px; border-bottom: 1px solid var(--line); background: var(--panel); }
.find { display: flex; gap: 8px; max-width: 620px; }
.find input { flex: 1; }
main { padding: 22px 28px 56px; }

.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.head h1 { font-size: 1.6rem; font-weight: 650; line-height: 1.2; letter-spacing: -.005em; }
.head h1 .plate { font-size: 1.15rem; vertical-align: 3px; margin-right: 6px; }
.crumb { font-size: .87rem; margin-bottom: 2px; }
.sub { margin-top: 6px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; row-gap: 4px; }
.sep { border-left: 1px solid var(--line); margin-left: 10px; padding-left: 10px; }
.lede { color: var(--muted); max-width: 76ch; margin-bottom: 14px; }
.hint { color: var(--muted); font-size: .87rem; margin-top: 4px; }
.empty { color: var(--muted); padding: 14px 0; }

.bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 28px; flex-wrap: wrap; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.bar .lede { margin-bottom: 8px; }
.tabs { display: flex; gap: 22px; }
.tabs a { display: block; padding: 6px 0 8px; color: var(--muted); text-decoration: none; font-weight: 550; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--frame); }
.n { font-weight: 400; color: var(--muted); margin-left: 3px; }
.filter { display: flex; align-items: center; gap: 8px; padding-bottom: 7px; }
.filter label { color: var(--muted); font-size: .9rem; }
.filter select { width: auto; max-width: 240px; padding: 5px 8px; }

/* ---------------------------------------------------------------- the code plate */

.plate { display: inline-flex; font-family: var(--code); font-size: .84rem; font-weight: 400; line-height: 1; color: var(--ink); background: #F3F4F2; border: 1px solid #8D9794; border-radius: 2px; white-space: nowrap; vertical-align: 1px; }
.plate span { padding: 4px 5px 3px; }
.plate span + span { border-left: 1px solid #8D9794; font-weight: 700; background: #fff; }
a .plate { color: var(--ink); }
a:hover .plate { border-color: var(--blue); }
.plate-big { font-size: 2rem; border-width: 2px; border-left: 7px solid var(--signal); border-radius: 3px; }
.plate-big span { padding: 10px 12px 8px; }
.plate-big span + span { border-left-width: 2px; }
.plates { line-height: 2.1; }
.keys-col { white-space: nowrap; width: 1%; }

.given { display: flex; align-items: center; gap: 20px; background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--frame); padding: 18px 22px; margin: 18px 28px 0; }
.given p { font-size: 1.05rem; max-width: 70ch; }
.given .quiet { margin-top: 6px; }

/* ---------------------------------------------------------------- board */

.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(214px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.col { background: var(--cabinet-deep); border-radius: 3px; padding: 0 7px 7px; min-height: 120px; }
.col header { padding: 10px 4px 8px; }
.col h2 { font-size: .93rem; font-weight: 650; line-height: 1.25; }
.col header p { font-size: .82rem; color: var(--muted); margin-top: 1px; }
.col ol { display: grid; gap: 6px; }
.col.over { outline: 2px dashed var(--blue); outline-offset: -2px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 3px; padding: 8px 9px; }
.card[draggable="true"] { cursor: grab; }
.card.dragging { opacity: .45; }
.card a { display: block; color: var(--ink); text-decoration: none; }
.card a:hover .card-name { color: var(--blue); text-decoration: underline; }
.card-name { display: block; font-weight: 550; font-size: .93rem; line-height: 1.3; margin-top: 4px; overflow-wrap: anywhere; }
.card .plate + .card-name { margin-top: 5px; }
.card-who { font-size: .85rem; color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
.card-foot { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: .8rem; color: var(--muted); margin-top: 5px; }
.card-foot span:first-child { color: var(--ink); font-weight: 600; }
.card-foot span:empty { display: none; }

/* ---------------------------------------------------------------- tables and panels */

.grid { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); }
.grid th { text-align: left; font-size: .82rem; font-weight: 600; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--line); background: #F6F7F5; }
.grid td { padding: 9px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; overflow-wrap: anywhere; }
.grid tr:last-child td { border-bottom: 0; }
.grid .num { text-align: right; white-space: nowrap; }
.grid.tight { border: 0; }
.grid.tight th { background: none; padding: 4px 10px 6px 0; }
.grid.tight td { padding: 7px 10px 7px 0; }
.grid.narrow { width: auto; min-width: 320px; }
.clip { max-width: 46ch; }
.grid td.empty { padding: 14px 12px; }
.grid.tight td.empty { padding-left: 0; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 3px; padding: 16px 18px 18px; margin-bottom: 16px; }
.panel h2 { font-size: 1.02rem; font-weight: 650; margin-bottom: 10px; }
.panel h3 { font-size: .93rem; font-weight: 650; margin: 14px 0 6px; }
.panel > p + p, .panel > p + form, .panel > ul + form, .panel > p + ul { margin-top: 8px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 348px; gap: 18px; align-items: start; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 78ch; }
.plain li { padding: 3px 0; overflow-wrap: anywhere; }
.people li { padding: 9px 0; border-bottom: 1px solid var(--line-soft); overflow-wrap: anywhere; }
.people li:last-child { border-bottom: 0; }
.facts { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 6px 14px; }
.facts dt { color: var(--muted); }
.facts dd:empty::after { content: "Not given"; color: #8A9399; }
.break { overflow-wrap: anywhere; }
details { margin-top: 10px; }
summary { cursor: pointer; color: var(--blue); font-weight: 550; }
code { font-family: var(--code); font-size: .88em; background: #F3F4F2; padding: 1px 5px; border-radius: 2px; }

.timeline { margin-top: 14px; }
.entry { padding: 10px 0 10px 12px; border-left: 3px solid var(--line-soft); margin-bottom: 8px; }
.entry-negotiation { border-left-color: var(--signal); }
.entry-system { border-left-color: var(--line-soft); color: var(--muted); }
.entry-head { font-size: .84rem; color: var(--muted); margin-bottom: 3px; display: flex; flex-wrap: wrap; align-items: center; row-gap: 3px; }
.entry-head .tag { margin-left: 10px; }

.tag { display: inline-block; font-size: .78rem; font-weight: 650; line-height: 1; padding: 4px 7px 3px; border: 1px solid currentColor; border-radius: 2px; color: var(--muted); background: #fff; white-space: nowrap; }
.tag-customer { color: var(--green); }
.tag-existing { color: var(--blue); }
.tag-unsure { color: #7A5B00; background: #FFF7DB; border-color: #D9A400; }
.tag-supplier { color: var(--frame); }
.tag-spam, .tag-phishing { color: var(--red); }

.notice { background: var(--panel); border: 1px solid var(--line); border-left: 5px solid var(--green); padding: 11px 16px; margin: 16px 28px 0; max-width: 90ch; }
.notice.error { border-left-color: var(--red); }
.notice.warn { border-left-color: var(--signal); }
main .notice, .alone .notice { margin: 0 0 16px; }
.alert { background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--signal); padding: 16px 18px; margin-bottom: 18px; max-width: 900px; }
.alert h2 { font-size: 1.08rem; font-weight: 650; margin-bottom: 8px; }
.alert p { margin-top: 10px; max-width: 76ch; }

/* ---------------------------------------------------------------- forms */

label, legend { display: block; font-size: .9rem; font-weight: 600; margin: 14px 0 4px; }
input[type="text"], input[type="email"], input[type="search"], input[type="file"], input:not([type]), select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid #8D9794; border-radius: 3px; padding: 7px 10px; }
input[type="file"] { padding: 6px; background: #F6F7F5; }
textarea { resize: vertical; min-height: 64px; }
input:disabled { background: #F0F1EF; color: var(--muted); }
input::placeholder, textarea::placeholder { color: #7C868C; }
.short { width: 64px !important; text-transform: uppercase; }
.form { max-width: 580px; }
.form > label:first-of-type, .stack > label:first-of-type { margin-top: 0; }
.stack > .button, .stack > button { margin-top: 14px; }
.stack fieldset + label { margin-top: 18px; }
.inline { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.actions { display: flex; gap: 16px; align-items: center; margin-top: 20px; }
.row { display: flex; gap: 18px; align-items: center; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }
.choice { display: flex; gap: 7px; align-items: baseline; font-weight: 400; font-size: 1rem; margin: 8px 0 0; cursor: pointer; }
.row .choice { margin: 0; }
.choice.wrap { padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.choice input { flex: none; }
.note-form textarea { display: block; }

.button, button { font: inherit; cursor: pointer; }
.button, .find button { display: inline-block; background: var(--blue); color: #fff; font-weight: 600; text-decoration: none; border: 1px solid var(--blue); border-radius: 3px; padding: 7px 14px; white-space: nowrap; }
.button:hover, .find button:hover { background: var(--blue-deep); border-color: var(--blue-deep); color: #fff; }
.button.second { background: #fff; color: var(--blue); }
.button.second:hover { background: #EEF3F9; color: var(--blue-deep); }
.button:disabled { background: #B9C0C4; border-color: #B9C0C4; cursor: not-allowed; }
.button.wide { display: block; text-align: center; padding: 10px 14px; }
.quiet { background: none; border: 0; padding: 0; color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }

.wide-form { max-width: 760px; }
.group { background: var(--panel); border: 1px solid var(--line); border-radius: 3px; padding: 4px 18px 18px; margin-bottom: 14px; }
.group legend { font-size: 1.02rem; font-weight: 650; padding: 0 6px; margin: 0 0 0 -6px; }
.group > label:first-of-type { margin-top: 4px; }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
@media (max-width: 620px) { .cols { grid-template-columns: minmax(0, 1fr); } }

.picker { position: relative; }
.picker-list { position: absolute; z-index: 5; left: 0; right: 0; background: #fff; border: 1px solid #8D9794; border-top: 0; border-radius: 0 0 3px 3px; max-height: 260px; overflow-y: auto; }
.picker-list button { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line-soft); padding: 8px 10px; white-space: pre-wrap; }
.picker-list button:hover, .picker-list button:focus { background: #EEF3F9; }
.picker-list .empty { padding: 8px 10px; }
.preview { min-height: 1.6rem; margin-top: 8px; font-size: .95rem; }
.preview ul { margin: 4px 0 0; }
.preview li { padding: 2px 0; }

.letters { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 14px; }
.letters a { width: 30px; height: 30px; display: grid; place-items: center; font-family: var(--code); font-size: .9rem; text-decoration: none; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 2px; }
.letters a:hover { border-color: var(--blue); }
.letters a[aria-current] { background: var(--frame); color: #fff; border-color: var(--frame); }

/* ---------------------------------------------------------------- signed out */

.alone { min-height: 100vh; display: grid; place-content: start center; padding: 13vh 16px 40px; }
.door { width: min(380px, 92vw); background: var(--panel); border: 1px solid var(--line); border-top: 5px solid var(--frame); padding: 30px 30px 32px; }
.door-org { color: var(--muted); font-size: .9rem; }
.door h1 { font-size: 2.1rem; font-weight: 700; line-height: 1.15; margin-top: 2px; }
.door-what { color: var(--muted); margin: 6px 0 24px; }
.door .stack { margin-top: 22px; }
.door .hint { margin-top: 10px; }
.alone .notice { width: min(380px, 92vw); }

/* ---------------------------------------------------------------- small screens */

@media (max-width: 980px) {
  .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 800px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "brand who" "nav nav"; align-items: center; }
  .brand { grid-area: brand; border: 0; padding: 12px 16px 4px; }
  .brand-org { display: none; }
  .who { grid-area: who; border: 0; padding: 12px 16px 4px; }
  .who-role, .who-name { display: none; }
  .side ul { grid-area: nav; display: flex; overflow-x: auto; padding: 0 6px; }
  .side li a { white-space: nowrap; padding: 9px 10px 8px; border-left: 0; border-bottom: 3px solid transparent; gap: 6px; }
  .side li a[aria-current] { border-bottom-color: var(--signal); }
  .top, main { padding-left: 16px; padding-right: 16px; }
  .given, .notice { margin-left: 16px; margin-right: 16px; }
  .given { flex-direction: column; align-items: flex-start; }
  .grid { display: block; overflow-x: auto; }
  .board { grid-auto-columns: 78vw; }
  .filter select { max-width: 60vw; }
}
@media (prefers-reduced-motion: no-preference) {
  .card, .button, .letters a { transition: border-color .12s, background-color .12s; }
}
