/* Doketly: the app's one stylesheet. Near-monochrome, dark and light with equal care; colour only for a ticket's
   state and its signals. The recurring mark is the ladder: six strokes from New to Completed. No inline style, no
   font or icon from another site. */

/* ---------- Tokens ---------- */
:root {
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --r-s: 4px; --r: 6px; --r-l: 10px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --top-h: 52px;
  --side-w: 236px;

  /* dark first */
  --bg: #0F1114; --panel: #14161A; --raised: #1A1D22; --hover: #1B1E24; --sel: #22262D;
  --line: #23262D; --line-2: #30343C; --text: #E8EAED; --text-2: #A4AAB3; --text-3: #848B95;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, .75), 0 0 0 1px rgba(255, 255, 255, .03);
  --shadow-s: 0 1px 2px rgba(0, 0, 0, .4);
  --hi: inset 0 1px 0 rgba(255, 255, 255, .045);
  --scrim: rgba(5, 6, 8, .6);
  /* state: the only colour, besides signals */
  --s-prop: #C792EA; --s-new: #9BA3AE; --s-plan: #6EA8E0; --s-prog: #E3B34C; --s-branch: #4EC4BC; --s-test: #8F9CF8; --s-done: #5DC48B; --s-closed: #5C636D;
  --g-part: #EE9A5C; --g-low: #F07A7A; --g-unread: #E86F9A;
  --seg-off: #2A2E35;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #FBFBFC; --panel: #FFFFFF; --raised: #F4F5F7; --hover: #F3F4F6; --sel: #EBEDF0;
    --line: #E6E8EC; --line-2: #D5D8DE; --text: #16181C; --text-2: #555B65; --text-3: #656B75;
    --shadow: 0 24px 60px -28px rgba(20, 24, 32, .28), 0 0 0 1px rgba(20, 24, 32, .04);
    --shadow-s: 0 1px 2px rgba(20, 24, 32, .06);
    --hi: inset 0 -1px 0 rgba(20, 24, 32, .03);
    --scrim: rgba(236, 238, 242, .66);
    --s-prop: #9446C9; --s-new: #7B828D; --s-plan: #2F6EAE; --s-prog: #B07A0E; --s-branch: #0F8A82; --s-test: #4A57D1; --s-done: #1E8A4F; --s-closed: #A9AEB6;
    --g-part: #C4621F; --g-low: #C83B3B; --g-unread: #C23A6E;
    --seg-off: #E3E5E9;
    color-scheme: light;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); scrollbar-color: var(--line-2) transparent; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  font: 14px/1.45 var(--font); background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
:where(button, input, select, textarea) { font: inherit; color: inherit; }
p, h1, h2, h3, ul, ol, dl, blockquote { margin: 0; }
::selection { background: color-mix(in srgb, var(--s-plan) 34%, transparent); }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: var(--r-s); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.num, time, .code { font-variant-numeric: tabular-nums; }
.code { letter-spacing: .01em; color: var(--text-2); font-weight: 500; }
code, .mono { font-family: var(--mono); font-size: .9em; }
code { padding: 1px 5px; border-radius: var(--r-s); background: var(--raised); border: 1px solid var(--line); color: var(--text); overflow-wrap: anywhere; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
kbd {
  display: inline-block; min-width: 18px; padding: 2px 5px; text-align: center;
  font: 500 11px/1 var(--font); color: var(--text-3);
  border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; background: var(--panel);
}

/* skip link: out of sight until focused */
.skip {
  position: fixed; left: 12px; top: -48px; z-index: 50; padding: 8px 12px; border-radius: var(--r);
  background: var(--text); color: var(--bg); font-weight: 500; transition: top .15s var(--ease);
}
.skip:focus { top: 12px; }

/* ---------- Controls ---------- */
.btn, :where(button:not(.btn):not(.item)) {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 11px;
  border: 1px solid var(--line-2); border-radius: var(--r); background: var(--panel); box-shadow: var(--hi), var(--shadow-s);
  color: var(--text); font-weight: 500; font-size: 13px; line-height: 1; white-space: nowrap; cursor: pointer;
  transition: background .12s var(--ease), border-color .12s var(--ease), color .12s var(--ease), transform .08s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover, :where(button:not(.btn):not(.item)):hover { background: var(--hover); border-color: color-mix(in srgb, var(--line-2) 60%, var(--text-3)); }
.btn:active, :where(button:not(.btn):not(.item)):active { transform: translateY(.5px); }
.btn svg.i { width: 15px; height: 15px; color: var(--text-2); }
/* the main button of an older form: alone in its paragraph */
.btn.primary, :where(p > button[type="submit"]:only-child:not(.btn)) {
  background: var(--text); color: var(--bg); border-color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), var(--shadow-s);
}
.btn.primary svg.i { color: inherit; }
.btn.primary:hover, :where(p > button[type="submit"]:only-child:not(.btn)):hover {
  background: color-mix(in srgb, var(--text) 88%, var(--bg)); border-color: color-mix(in srgb, var(--text) 88%, var(--bg));
}
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.icon { width: 30px; padding: 0; }
.btn.sm { height: 26px; padding: 0 9px; font-size: 12.5px; }
.btn.sm.icon { width: 26px; }
.btn.danger { color: var(--g-low); }
.btn.danger:hover { background: color-mix(in srgb, var(--g-low) 12%, var(--panel)); border-color: color-mix(in srgb, var(--g-low) 45%, var(--line-2)); }

:where(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea) {
  min-height: 32px; padding: 6px 10px; max-width: 100%;
  border: 1px solid var(--line-2); border-radius: var(--r); background: var(--panel); color: var(--text);
  font-size: 13.5px; line-height: 1.4; box-shadow: var(--shadow-s);
  transition: border-color .12s var(--ease), box-shadow .12s var(--ease);
}
:where(select) {
  appearance: none; -webkit-appearance: none; padding-right: 28px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 14px) 52%, calc(100% - 10px) 52%; background-size: 4px 4px; background-repeat: no-repeat;
}
:where(textarea) { resize: vertical; line-height: 1.5; }
:where(input, select, textarea):hover { border-color: color-mix(in srgb, var(--line-2) 55%, var(--text-3)); }
:where(input, select, textarea):focus { outline: none; }
:where(input:not([type="checkbox"]):not([type="radio"]), select, textarea):focus-visible {
  outline: none; border-color: var(--text-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 14%, transparent);
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--text); width: 15px; height: 15px; margin: 0 6px 0 0; vertical-align: -2px; }
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
::placeholder { color: var(--text-3); opacity: 1; }

/* the avatar of a person, the mark of an agent */
.av {
  width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  font-size: 9.5px; font-weight: 600; letter-spacing: .02em; color: var(--text-2);
  background: var(--raised); border: 1px solid var(--line-2);
}
.av.ag { border-radius: 5px; }
.av.ag svg.i { width: 11px; height: 11px; }
.av.none { border-style: dashed; background: transparent; }

/* priority: three bars; urgent a red square */
.prio { display: inline-flex; align-items: flex-end; gap: 2px; width: 14px; height: 12px; flex: none; }
.prio i { display: block; width: 3px; border-radius: 1px; background: var(--seg-off); }
.prio i:nth-child(1) { height: 5px; } .prio i:nth-child(2) { height: 8px; } .prio i:nth-child(3) { height: 11px; }
.prio.p-low i:nth-child(-n+1), .prio.p-normal i:nth-child(-n+2), .prio.p-high i { background: var(--text-2); }
.prio.p-urgent { width: 13px; height: 13px; border-radius: 3.5px; background: var(--g-low); align-items: center; justify-content: center; }
.prio.p-urgent i { display: none; }
.prio.p-urgent::before { content: "!"; color: var(--bg); font: 800 10px/1 var(--font); }

/* signals */
.sig { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.sig svg.i { width: 14px; height: 14px; color: var(--text-2); }
.sig.partial svg.i { color: var(--g-part); }
.sig.regressed svg.i { color: var(--g-low); }
.sig.unreadable svg.i { color: var(--g-unread); }

/* ---------- The ladder: six strokes, New to Completed ---------- */
.lad, .ladder { --c: var(--text-3); }
.st-prop { --c: var(--s-prop); } .st-new { --c: var(--s-new); } .st-plan { --c: var(--s-plan); } .st-prog { --c: var(--s-prog); }
.st-branch { --c: var(--s-branch); } .st-test { --c: var(--s-test); } .st-done { --c: var(--s-done); } .st-closed { --c: var(--s-closed); }

.lad { display: inline-flex; gap: 2px; align-items: center; flex: none; position: relative; }
.lad i { display: block; position: relative; width: 9px; height: 4px; border-radius: 1px; background: var(--seg-off); overflow: hidden; }
.lad i.on { background: var(--c); }
/* held: a level the facts reached, kept back by a send back */
.lad i.held, .ladder .stp.held i {
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 70%, transparent) 0 1.5px, transparent 1.5px 3.5px);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 75%, transparent);
}
/* was: a level a revert or a rollback took away */
.lad i.was, .ladder .stp.was i {
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--g-low) 60%, transparent) 0 1.5px, transparent 1.5px 3.5px);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--g-low) 80%, transparent);
}
.lad.st-prop i:first-child { background: transparent; box-shadow: inset 0 0 0 1px var(--c); }
.lad.st-closed::after { content: ""; position: absolute; left: -2px; right: -2px; top: 50%; height: 1px; margin-top: -.5px; background: var(--text-3); }

.ladder { position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 3px; max-width: 700px; margin-top: 28px; }
.ladder .stp { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.ladder .stp i { display: block; position: relative; height: 5px; border-radius: 2px; background: var(--seg-off); overflow: hidden; }
.ladder .stp.on i { background: var(--c); }
.ladder .stp.cur i { box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 30%, transparent), 0 0 14px -2px color-mix(in srgb, var(--c) 55%, transparent); overflow: visible; }
.ladder .stp span { font-size: 12px; line-height: 1.3; color: var(--text-3); overflow-wrap: anywhere; }
.ladder .stp.on span { color: var(--text-2); }
.ladder .stp.cur span { color: var(--text); font-weight: 600; }
.ladder .stp.was span { color: var(--g-low); }
.ladder.st-prop .stp:first-child i { background: transparent; box-shadow: inset 0 0 0 1px var(--c); }
.ladder.st-closed .stp i { opacity: .55; }
.ladder.st-closed::after { content: ""; position: absolute; left: -3px; right: -3px; top: 2px; height: 1px; background: var(--text-3); }

/* the ladder's movement, set by app.js when a ticket rose or fell since it was last seen */
.lad i.rise, .ladder .stp i.rise { animation: lad-rise .55s var(--ease-out) both; animation-delay: calc(var(--k, 0) * 90ms + 140ms); transform-origin: left center; }
@keyframes lad-rise {
  0% { transform: scaleX(0); opacity: .2; }
  60% { filter: brightness(1.35); }
  100% { transform: none; opacity: 1; filter: none; }
}
.lad i.fall::after, .ladder .stp i.fall::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--g-low); transform-origin: left center;
  animation: lad-fall .7s var(--ease) both; animation-delay: calc(var(--k, 0) * 110ms + 220ms);
}
@keyframes lad-fall { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* the state as a pill, and the small state dots */
.pill {
  display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 11px 0 9px; border-radius: 999px;
  font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap;
  background: color-mix(in srgb, var(--c, var(--text-3)) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--c, var(--text-3)) 30%, transparent);
}
.pill i, .repos .v i { width: 7px; height: 7px; border-radius: 2px; background: var(--c, var(--text-3)); flex: none; }
.pill i { box-shadow: 0 0 8px color-mix(in srgb, var(--c) 70%, transparent); }

/* ---------- Menus: <details> with a pop ---------- */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.pop {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; min-width: 220px; padding: 5px;
  display: flex; flex-direction: column; gap: 1px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-l); box-shadow: var(--shadow), var(--hi);
  transform-origin: top left; animation: pop-in .14s var(--ease-out);
}
.menu.up > .pop { top: auto; bottom: calc(100% + 6px); transform-origin: bottom left; }
@keyframes pop-in { from { opacity: 0; transform: translateY(-3px) scale(.98); } }
.pop form { display: contents; }
.pop .item {
  all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px;
  border-radius: var(--r); font-size: 13px; color: var(--text); cursor: pointer; white-space: nowrap;
}
.pop .item svg.i { color: var(--text-3); }
.pop .item:hover, .pop .item:focus-visible { background: var(--hover); outline: none; }
.pop .item:focus-visible { box-shadow: inset 0 0 0 1px var(--text-3); }
.pop .item:hover svg.i { color: var(--text-2); }
.pop hr { border: 0; border-top: 1px solid var(--line); margin: 4px 2px; }

/* a form inside a pop: send back, close */
.pop .sub { display: flex; flex-direction: column; gap: 9px; padding: 8px 8px 10px; }
.pop .sub-h { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.pop .sub-h svg.i { color: var(--text-3); }
.pop .sub label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--text-2); }
.pop .sub :where(input, select, textarea) { width: 100%; }
.pop .sub .btn { align-self: flex-end; }
.pop.wide { min-width: 300px; }
.pop .narrow { display: none; }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.side {
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 20px; padding: 12px 10px; min-width: 0;
  background: var(--panel); border-right: 1px solid var(--line); scrollbar-width: none;
  view-transition-name: side;
}
.ws { display: flex; align-items: center; gap: 9px; padding: 4px 6px; font-weight: 600; font-size: 13px; min-height: 30px; }
.mark { width: 22px; height: 22px; border-radius: 6px; background: var(--text); display: grid; place-items: center; flex: none; box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25); }
.mark svg.i { width: 15px; height: 15px; stroke: none; fill: var(--bg); }
.ws-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.side-close { display: none; margin-left: auto; }

.nav { display: flex; flex-direction: column; gap: 1px; }
.nav h2 { font-size: 12px; font-weight: 500; color: var(--text-3); margin: 0 0 4px; padding: 0 8px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 9px; height: 30px; padding: 0 8px; border-radius: var(--r);
  color: var(--text-2); font-size: 13px; white-space: nowrap; transition: background .1s linear, color .1s linear;
}
.nav a .t { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.nav a svg.i { color: var(--text-3); }
.nav a:hover { background: var(--hover); color: var(--text); }
.nav a[aria-current] { background: var(--sel); color: var(--text); font-weight: 500; box-shadow: var(--hi); }
.nav a[aria-current] svg.i { color: var(--text); }
.nav a .n { margin-left: auto; font-size: 12px; color: var(--text-3); font-weight: 400; }
.nav a .pj {
  width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--line-2); display: grid; place-items: center; flex: none;
  font-size: 9px; font-weight: 700; color: var(--text-2);
}

.me { margin-top: auto; }
.me > summary {
  display: flex; align-items: center; gap: 9px; height: 36px; padding: 0 8px; border-radius: var(--r);
  font-size: 13px; color: var(--text-2);
}
.me > summary:hover, .me[open] > summary { background: var(--hover); color: var(--text); }
.me > summary .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.me > summary .chev { margin-left: auto; width: 14px; height: 14px; color: var(--text-3); }
.me > .pop { left: 0; right: 0; min-width: 0; }

.scrim { display: none; }

.main { display: flex; flex-direction: column; min-width: 0; }
.main:focus { outline: none; }

.top {
  position: sticky; top: 0; z-index: 10; height: var(--top-h); flex: none;
  display: flex; align-items: center; gap: 10px; padding: 0 16px 0 20px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
  view-transition-name: top;
}
.top .menu { display: none; }
.top .title { display: flex; align-items: center; gap: 8px; min-width: 0; margin: 0; font-size: 14px; font-weight: 600; white-space: nowrap; }
.top .title .n { color: var(--text-3); font-weight: 400; }
.top .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.top .back { margin-left: -8px; margin-right: -4px; }

.crumbs { font-weight: 400; overflow: hidden; }
.top .crumbs { font-weight: 400; }
.crumbs a { color: var(--text-3); border-radius: var(--r-s); transition: color .1s linear; }
.crumbs a:hover { color: var(--text); }
.crumbs .sep { color: var(--line-2); }
.crumbs .cur { color: var(--text); font-weight: 600; }

.search {
  position: relative; flex: 1; max-width: 440px; margin-left: 14px; display: flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 6px 0 10px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--panel); color: var(--text-3); transition: border-color .12s var(--ease), box-shadow .12s var(--ease);
}
.search:hover { border-color: var(--line-2); }
.search:focus-within { border-color: var(--text-3); box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 10%, transparent); }
.search input {
  flex: 1; min-width: 0; min-height: 0; height: 100%; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none;
  font-size: 13px; color: var(--text); outline: none;
}
.search input:focus-visible { box-shadow: none; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search kbd { transition: opacity .12s; }
.search:focus-within kbd { opacity: 0; }

.alert {
  display: flex; align-items: flex-start; gap: 10px; margin: 16px 20px 0; padding: 10px 14px; border-radius: var(--r);
  font-size: 13.5px; color: var(--text);
  background: color-mix(in srgb, var(--g-low) 10%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--g-low) 38%, var(--line));
}
.alert svg.i { color: var(--g-low); margin-top: 1px; }

/* ---------- The list ---------- */
.filters {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 47px;
  padding: 9px 16px 9px 20px; border-bottom: 1px solid var(--line);
}
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 3px 0 9px;
  border: 1px solid var(--line-2); border-radius: var(--r); background: var(--panel); box-shadow: var(--hi);
  font-size: 12.5px; color: var(--text-2); white-space: nowrap; animation: chip-in .2s var(--ease-out);
}
@keyframes chip-in { from { opacity: 0; transform: scale(.96); } }
.chip b { font-weight: 500; color: var(--text); max-width: 26ch; overflow: hidden; text-overflow: ellipsis; }
.chip a { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 4px; color: var(--text-3); }
.chip a:hover { background: var(--hover); color: var(--text); }
.chip a svg.i { width: 12px; height: 12px; }
.addf > summary { color: var(--text-2); }
.addf[open] > summary { background: var(--hover); color: var(--text); }
.filter-form { min-width: 320px; padding: 12px; gap: 10px; }
.filter-form label { display: grid; grid-template-columns: 108px minmax(0, 1fr); align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-2); }
.filter-form select { width: 100%; min-height: 30px; padding-top: 4px; padding-bottom: 4px; font-size: 13px; }
.filter-form .btn { margin-top: 4px; align-self: flex-end; }
.filters .sort { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.filters .sort svg.i { width: 14px; height: 14px; }

.list { padding: 0 0 8px; }
.grp-sec + .grp-sec { margin-top: 14px; }
.grp {
  position: sticky; top: var(--top-h); z-index: 2;
  display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 16px 0 20px;
  font-size: 12.5px; font-weight: 500; color: var(--text-2);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.grp .n { color: var(--text-3); font-weight: 400; }
.rows { list-style: none; padding: 0; }
.row {
  position: relative; display: grid;
  grid-template-columns: 16px 62px minmax(0, 1fr) auto 236px 50px 54px;
  grid-template-areas: "p c t g s o d";
  align-items: center; column-gap: 14px; min-height: 42px; padding: 0 16px 0 20px;
  border-bottom: 1px solid var(--line); scroll-margin: calc(var(--top-h) + 44px) 0 24px;
  transition: background .08s linear;
}
.row:hover { background: var(--hover); }
.row:active { background: var(--sel); }
.row:focus-visible { outline: none; border-radius: 0; background: var(--sel); box-shadow: inset 0 0 0 1px var(--line-2); }
.row::before {
  content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 2px; border-radius: 2px;
  background: var(--text); opacity: 0; transform: scaleY(.4); transition: opacity .12s var(--ease), transform .18s var(--ease-out);
}
.row:focus-visible::before { opacity: 1; transform: none; }
.row.here { animation: here 2s var(--ease) both; }
@keyframes here { 0%, 30% { background: var(--sel); } 100% { background: transparent; } }
.row .prio { grid-area: p; }
.row .code { grid-area: c; font-size: 12.5px; white-space: nowrap; }
.row .t { grid-area: t; justify-self: start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.row .g { grid-area: g; display: flex; gap: 9px; }
.row .st { grid-area: s; display: inline-flex; align-items: center; gap: 10px; min-width: 0; font-size: 13px; white-space: nowrap; }
.row .sn { overflow: hidden; text-overflow: ellipsis; }
.row .people { grid-area: o; display: grid; grid-template-columns: repeat(2, 20px); align-items: center; justify-content: end; gap: 3px; }
.row .d { grid-area: d; text-align: right; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.row.closed .t, .row.closed .sn, .row.closed .code { color: var(--text-3); }

.keys {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 22px; padding: 22px 20px 28px;
  font-size: 12px; color: var(--text-3);
}
.keys span { display: inline-flex; align-items: center; gap: 4px; }
.keys kbd:last-of-type { margin-right: 4px; }

/* the empty list */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 88px 24px 96px; }
.empty .lad.big { gap: 4px; margin-bottom: 14px; }
.empty .lad.big i { width: 22px; height: 6px; border-radius: 2px; animation: wave 2.4s var(--ease) 1 both; }
.empty .lad.big i:nth-child(2) { animation-delay: .1s; } .empty .lad.big i:nth-child(3) { animation-delay: .2s; }
.empty .lad.big i:nth-child(4) { animation-delay: .3s; } .empty .lad.big i:nth-child(5) { animation-delay: .4s; }
.empty .lad.big i:nth-child(6) { animation-delay: .5s; }
@keyframes wave { 0%, 100% { background: var(--seg-off); } 35% { background: var(--text-3); } }
.empty h2 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.empty p { max-width: 46ch; color: var(--text-2); font-size: 13.5px; line-height: 1.55; }
.empty .acts { display: flex; gap: 8px; margin-top: 10px; }

/* ---------- The switch between the list and the board ---------- */
.seg { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); box-shadow: var(--hi); }
.seg a {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 4px;
  font-size: 12.5px; font-weight: 500; color: var(--text-2); transition: background .1s linear, color .1s linear;
}
.seg a svg.i { width: 14px; height: 14px; color: var(--text-3); }
.seg a:hover { background: var(--hover); color: var(--text); }
.seg a[aria-current] { background: var(--sel); color: var(--text); box-shadow: var(--shadow-s), var(--hi); }
.seg a[aria-current] svg.i { color: var(--text); }

/* ---------- The board: one column per state ---------- */
.main:has(> .board) { height: 100vh; height: 100dvh; overflow: hidden; }
.board {
  position: relative; flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(7, minmax(148px, 1fr));
  grid-template-rows: auto minmax(0, 1fr);
  overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
.col {
  /* the heads share one row of the board, so every column's cards start at the same height */
  display: grid; grid-row: 1 / -1; grid-template-rows: subgrid; grid-template-columns: minmax(0, 1fr); align-content: start;
  min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain;
  border-right: 1px solid var(--line); scrollbar-width: none; transition: background .18s var(--ease);
}
.col:last-child { border-right: 0; }
/* the columns the facts fill mainly: a quieter ground */
.col.fact { background: color-mix(in srgb, var(--raised) 38%, transparent); }
.col-h {
  position: sticky; top: 0; z-index: 3; display: flex; flex-direction: column; gap: 7px; padding: 14px 12px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.col.fact .col-h { background: color-mix(in srgb, color-mix(in srgb, var(--raised) 38%, var(--bg)) 88%, transparent); }
.col-h .lad i { width: 7px; height: 3px; }
.col-h .h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; row-gap: 9px; min-width: 0; }
.col-h .h > .lad { flex: 0 0 100%; }
/* a state's name reads whole: it wraps rather than being cut */
.col-h h2 { flex: 0 1 auto; min-width: 0; margin: 0; font-size: 12.5px; font-weight: 600; letter-spacing: -.003em; line-height: 1.3; overflow-wrap: anywhere; }
.col-h .n { margin-left: auto; font-size: 12px; color: var(--text-3); }
.col-h .how { display: flex; gap: 5px; font-size: 11.5px; line-height: 1.35; color: var(--text-3); }
.col-h .how svg.i { width: 12px; height: 12px; margin-top: 1px; color: var(--c); }

.cards { list-style: none; display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 2px 8px 24px; flex: 1; align-self: start; min-height: 100%; }
.cards:empty::before { content: ""; display: block; height: 58px; border: 1px dashed var(--line); border-radius: var(--r); }

/* a card: code and menu, title, signals and people */
.kc {
  position: relative; display: flex; flex-direction: column; gap: 7px; padding: 9px 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--hi), var(--shadow-s);
  transition: border-color .12s var(--ease), box-shadow .16s var(--ease), opacity .16s var(--ease);
}
.kc:hover { border-color: var(--line-2); box-shadow: var(--hi), 0 4px 14px -8px rgba(0, 0, 0, .35); }
.kc.prop { border-style: dashed; border-color: var(--line-2); background: color-mix(in srgb, var(--panel) 55%, transparent); box-shadow: none; }
.kc.dnd { cursor: grab; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.kc.dnd .tt { -webkit-touch-callout: none; }
.kc .c1 { display: flex; align-items: center; gap: 7px; min-height: 20px; }
.kc .code { font-size: 12px; white-space: nowrap; }
.kc .tt { font-size: 13px; line-height: 1.38; color: var(--text); overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; }
/* the title's link covers the card; the menu sits above it */
.kc .tt::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.kc .tt:focus-visible { outline: none; }
.kc:has(.tt:focus-visible) { outline: 2px solid var(--text); outline-offset: 2px; }
.kc .c2 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-height: 20px; min-width: 0; }
.kc .c2 .sig svg.i { width: 13px; height: 13px; }
.kc .sig.sb { gap: 4px; font-size: 11.5px; }
.kc .sig.sb svg.i { color: var(--s-prog); }
.kc .by { flex: 1 1 auto; min-width: 0; font-size: 11.5px; line-height: 1.35; color: var(--text-3); overflow-wrap: anywhere; }
.kc .people { margin-left: auto; display: inline-flex; gap: 3px; }

.kc-m { margin: -2px -5px -2px auto; z-index: 2; }
.kc-m[open] { z-index: 20; }
.kc-m > summary { width: 24px; height: 22px; color: var(--text-3); opacity: 0; transition: opacity .12s var(--ease), background .1s linear; }
.kc:hover .kc-m > summary, .kc:focus-within .kc-m > summary, .kc-m[open] > summary { opacity: 1; }
.kc-m[open] > summary { background: var(--hover); color: var(--text); }
/* the menu floats over the board, out of its column's scroll: under its button, to the left */
.kc-m > .pop {
  position: fixed; top: auto; left: auto; width: 300px; min-width: 0; margin: 6px 0 0 calc(24px - 300px);
  max-height: calc(100vh - 24px); overflow-y: auto; transform-origin: top right;
}
.col:first-child .kc-m > .pop { margin-left: 0; transform-origin: top left; }
.kc-m .item .l { overflow: hidden; text-overflow: ellipsis; }
.kc-m .item .to { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding-left: 10px; font-size: 12px; color: var(--text-3); }
.kc-m .item .to i { width: 7px; height: 7px; border-radius: 2px; background: var(--c); }
.kc-m .sub textarea { min-height: 56px; }

/* dragging: the columns a card may go to open up, the others step back */
.kc.dragging { opacity: .35; }
.kc.ghost {
  position: fixed; z-index: 50; margin: 0; pointer-events: none; cursor: grabbing; rotate: .8deg;
  border-color: var(--line-2); box-shadow: var(--hi), 0 14px 32px -12px rgba(0, 0, 0, .45), 0 2px 6px -2px rgba(0, 0, 0, .2);
}
.board.drag { cursor: grabbing; scroll-snap-type: none; }
.board.drag .kc { transition: none; }
.board.drag .col.can { background: color-mix(in srgb, var(--c) 5%, transparent); }
.board.drag .col.can .cards { outline: 1px dashed color-mix(in srgb, var(--c) 50%, transparent); outline-offset: -3px; border-radius: var(--r-l); }
.board.drag .col.no .cards > li, .board.drag .col.no .col-h { opacity: .4; transition: opacity .18s var(--ease); }
.board .col.over { background: color-mix(in srgb, var(--c) 12%, transparent); }
.board .col.over .cards { outline-style: solid; }
.board .col.over .col-h h2 { color: var(--c); }
.kc.pending { opacity: .7; pointer-events: none; }
.kc.pending::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--c), transparent); background-size: 50% 100%; background-repeat: no-repeat;
  animation: pending 1s linear infinite;
}
@keyframes pending { from { background-position: -100% 0; } to { background-position: 200% 0; } }
.kc.here { animation: kc-here 1.8s var(--ease) both; }
@keyframes kc-here { 0%, 30% { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); } }
.kc.refused { animation: kc-refused .5s var(--ease) both; }
@keyframes kc-refused { 0%, 40% { border-color: var(--g-low); box-shadow: 0 0 0 3px color-mix(in srgb, var(--g-low) 18%, transparent); } }

.board-foot {
  flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding: 9px 20px;
  border-top: 1px solid var(--line); font-size: 12px; color: var(--text-3);
}
.board-foot a { color: var(--text-2); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.board-foot a:hover { color: var(--text); }

/* the reason of a send back asked by a drop, and the app's answer */
.sheet {
  position: fixed; z-index: 45; right: 20px; bottom: 20px; width: min(380px, calc(100vw - 24px));
  display: flex; flex-direction: column; gap: 10px; padding: 14px 14px 12px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-l); box-shadow: var(--shadow), var(--hi);
  animation: sheet-in .22s var(--ease-out);
}
.sheet[hidden] { display: none; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(8px); } }
.sheet .sh { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; }
.sheet .sh svg.i { color: var(--s-prog); }
.sheet .sh #sheet-t { display: flex; align-items: center; flex-wrap: wrap; gap: 0 4px; min-width: 0; }
.sheet .sh .to { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; padding: 1px 8px 1px 7px; border: 1px solid var(--line-2); border-radius: 99px; font-size: 12px; font-weight: 500; color: var(--text-2); }
.sheet .sh .to i { width: 7px; height: 7px; border-radius: 2px; background: var(--c); }
.sheet .sh-p { font-size: 12.5px; line-height: 1.5; color: var(--text-2); }
.sheet label { font-size: 12px; color: var(--text-2); }
.sheet textarea { width: 100%; min-height: 64px; }
.sheet .acts { display: flex; justify-content: flex-end; gap: 8px; }
.toast {
  position: fixed; z-index: 46; left: 50%; bottom: 20px; max-width: min(520px, calc(100vw - 24px));
  display: flex; align-items: center; gap: 9px; padding: 9px 14px; border-radius: var(--r);
  background: var(--text); color: var(--bg); font-size: 13px; line-height: 1.4; box-shadow: var(--shadow);
  opacity: 0; transform: translate(-50%, 8px); pointer-events: none;
  transition: opacity .2s var(--ease), transform .24s var(--ease-out);
}
.toast:empty { display: none; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.bad::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--g-low); flex: none; }

/* ---------- The ticket ---------- */
.tk { display: grid; grid-template-columns: minmax(0, 1fr) 320px; flex: 1; }
.tk-doc { width: 100%; max-width: 860px; padding: 40px 48px 72px; }
.tk-props {
  display: flex; flex-direction: column; gap: 28px; padding: 28px 24px 40px;
  border-left: 1px solid var(--line);
  background: linear-gradient(to bottom, color-mix(in srgb, var(--panel) 60%, transparent), transparent 480px);
}
.tk-head .k { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--text-3); }
.tk-head .k .code { color: var(--text-2); }
.sepdot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-2); flex: none; }
.tk-code { view-transition-name: tk-code; }
.tk-title {
  margin-top: 10px; max-width: 34ch; width: fit-content; font-size: 28px; line-height: 1.22; letter-spacing: -.02em; font-weight: 600;
  text-wrap: balance; overflow-wrap: anywhere; view-transition-name: tk-title;
}
.stateline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 18px; }
.stateline .sig { font-size: 13px; white-space: normal; }
.stateline .sig b { font-weight: 500; color: var(--text); }

/* the cards: sent back, closed, proposed */
.card {
  position: relative; display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; column-gap: 12px; row-gap: 5px;
  align-items: start; max-width: 700px; margin-top: 24px; padding: 14px 16px 14px 18px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--hi), var(--shadow-s);
  overflow: hidden; --accent: var(--text-3);
}
.card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--accent); }
.card.back { --accent: var(--s-prog); }
.card.closed-card { --accent: var(--s-closed); }
.card.accept { --accent: var(--s-prop); overflow: visible; box-shadow: inset 2px 0 0 var(--accent), var(--hi), var(--shadow-s); }
.card.accept::before { content: none; } /* its menu must not be clipped: the bar is drawn by the shadow */
.card .lead { grid-column: 1; grid-row: 1; margin-top: 1px; color: var(--accent); }
.card > :not(.lead):not(form) { grid-column: 2; }
.card > form { grid-column: 3; grid-row: 1 / span 3; align-self: start; }
.card .who { font-size: 13px; color: var(--text-2); }
.card .who b { color: var(--text); font-weight: 500; }
.card blockquote { margin: 2px 0; font-size: 15px; line-height: 1.5; color: var(--text); overflow-wrap: anywhere; }
.card blockquote::before { content: "«"; color: var(--text-3); }
.card blockquote::after { content: "»"; color: var(--text-3); }
.card .hold { font-size: 12.5px; color: var(--text-3); }
.card .why-closed { font-size: 13.5px; color: var(--text-2); }
.card .why-closed b { color: var(--text); font-weight: 500; }
.row-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 6px; }
.row-form label { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.row-form > form { display: contents; }
.row-form > .more { margin-left: auto; }
.row-form > .more > .pop { left: auto; right: 0; transform-origin: top right; }

.acts-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 24px; }
.acts-row > form { display: contents; }
.more > summary { color: var(--text-2); }
.more[open] > summary { background: var(--hover); color: var(--text); }

.desc { margin-top: 36px; max-width: 66ch; font-size: 15.5px; line-height: 1.7; color: var(--text); overflow-wrap: anywhere; }
.desc p + p { margin-top: .85em; }
.desc.none { color: var(--text-3); font-size: 14px; }

.sec-h { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.sec-h h2 { font-size: 14.5px; font-weight: 600; letter-spacing: -.005em; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-left: auto; font-size: 12px; color: var(--text-3); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.why { margin-top: 44px; }
.hist { margin-top: 40px; }

/* who acted: a person a dot, an agent a diamond, a fact of a repository a square */
.mk { position: relative; display: inline-block; width: 12px; height: 12px; flex: none; }
.mk::before { content: ""; position: absolute; }
.mk.person::before { inset: 2.5px; border-radius: 50%; background: var(--text-2); }
.mk.agent::before { inset: 2.5px; transform: rotate(45deg); border: 1.5px solid var(--text-2); border-radius: 1px; }
.mk.fact::before { inset: 2px; border: 1.5px solid var(--text-3); border-radius: 2px; }
.mk.sys::before { inset: 3.5px; border-radius: 50%; border: 1.5px solid var(--text-3); }

.reasons { list-style: none; padding: 0; }
.reasons li {
  display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: baseline; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px;
}
.reasons li .mk { align-self: center; }
.reasons .tx, .tl .tx { color: var(--text-2); overflow-wrap: anywhere; }
.reasons .tx b, .tl .tx b { color: var(--text); font-weight: 500; }
.reasons .dt { font-size: 12.5px; color: var(--text-3); white-space: nowrap; }

/* the history: a quiet timeline */
.tl { position: relative; list-style: none; padding: 6px 0 0; }
.tl::before { content: ""; position: absolute; left: calc(52px + 14px + 5.5px); top: 20px; bottom: 16px; width: 1px; background: var(--line); }
.tl li { position: relative; display: grid; grid-template-columns: 52px 12px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 7px 0; font-size: 13.5px; }
.tl .dt { font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.tl .mk { background: var(--bg); box-shadow: 0 0 0 3px var(--bg); border-radius: 3px; }
.tl .to { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.tl .to::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--c, var(--text-3)); flex: none; }
.tl li.down .to { color: var(--text); }
.tl li.down .to::before { display: none; }
.tl li.down .to svg.i { width: 14px; height: 14px; color: var(--g-low); }
.tl li:hover .tx { color: var(--text); }

/* the properties */
.props { display: grid; grid-template-columns: 108px minmax(0, 1fr); font-size: 13px; }
.props dt { padding: 6px 0; color: var(--text-3); }
.props dd { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; margin: 0; padding: 6px 0; overflow-wrap: anywhere; }
.props dd a { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.props dd a:hover { text-decoration-color: var(--text-3); }
.props .via { color: var(--text-3); font-size: 12px; }
.tk-props .ph { display: block; margin: 0; } /* a section of the properties, not the head of an admin page */
.ph h2 { margin-bottom: 10px; font-size: 12px; font-weight: 500; color: var(--text-3); }
.ph .none { font-size: 13px; color: var(--text-3); }
.takes { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.takes li { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: start; gap: 10px; }
.takes .nm { font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.takes .via { margin-top: 1px; font-size: 12px; color: var(--text-3); line-height: 1.4; }
.repos { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 9px; font-size: 13px; }
.repos li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.repos li > svg.i { color: var(--text-3); }
.repos .r { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.repos .v { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.repos .v.yes { color: var(--text); }
.repos .v.unread { color: var(--text-2); }
.repos .v.unread svg.i { width: 14px; height: 14px; color: var(--g-unread); }

/* an agent's proposal: a card whose edge takes the colour of the state it asks for, dashed while it waits */
.card.prop { --accent: var(--c, var(--text-3)); animation: rise-in .32s var(--ease-out) both; }
.card.prop.to-new { --c: var(--s-new); } .card.prop.to-plan { --c: var(--s-plan); } .card.prop.to-prog { --c: var(--s-prog); }
.card.prop.to-branch { --c: var(--s-branch); } .card.prop.to-test { --c: var(--s-test); } .card.prop.to-done { --c: var(--s-done); }
.card.prop.to-closed { --c: var(--s-closed); }
.card.prop {
  background: linear-gradient(100deg, color-mix(in srgb, var(--accent) 6%, var(--panel)), var(--panel) 46%);
  border-color: color-mix(in srgb, var(--accent) 22%, var(--line));
}
.card.prop::before { background: repeating-linear-gradient(to bottom, var(--accent) 0 5px, transparent 5px 8px); }
.card.prop .who { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; line-height: 1.45; }
.card.prop .who .to {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px 0 8px; border-radius: 99px; white-space: nowrap;
  font-size: 12px; font-weight: 500; color: var(--text);
  background: color-mix(in srgb, var(--c) 10%, transparent); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
}
.card.prop .who .to i { width: 7px; height: 7px; border-radius: 2px; background: var(--c); box-shadow: 0 0 8px color-mix(in srgb, var(--c) 60%, transparent); }
/* its acts span the card's rows: the rows keep no gap of their own, so the empty ones add no height */
.card.prop { row-gap: 0; }
.card.prop > :is(blockquote, .why-closed, .hold, .ferr) { margin-top: 5px; }
.card.prop > .card-acts { grid-column: 3; grid-row: 1 / span 4; align-self: start; display: flex; align-items: center; gap: 6px; }
.card.prop > .card-acts > form { display: contents; }

/* the commits said for the ticket: role, id, title; under them where and who */
.links { margin-top: 44px; }
.sec-h .n { font-size: 12px; color: var(--text-3); }
.commits { list-style: none; padding: 0; }
.commits li {
  display: grid; grid-template-columns: 64px auto minmax(0, 1fr) auto; grid-template-areas: "r s t f" ". c c c";
  align-items: center; column-gap: 12px; row-gap: 4px; padding: 10px 0 11px; border-bottom: 1px solid var(--line); font-size: 13.5px;
}
.commits .role {
  grid-area: r; justify-self: start; display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: var(--r-s);
  font: 500 11px/1 var(--mono); letter-spacing: .01em; color: var(--text-2); border: 1px solid var(--line-2); background: var(--panel);
}
.commits .role.r-wip { border-style: dashed; background: transparent; } /* work in progress: said, not yet counted */
.commits .role.r-revert, .commits .role.r-folded, .commits .role.r-docs { color: var(--text-3); background: transparent; }
.commits code.sha {
  grid-area: s; padding: 2px 6px; font-size: 12px; letter-spacing: .02em; color: var(--text); background: var(--raised); border-color: var(--line);
  font-variant-numeric: tabular-nums; cursor: help;
}
.commits .ct { grid-area: t; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.commits .ct .none { color: var(--text-3); }
.commits li > form { grid-area: f; }
.commits li > form .btn { color: var(--text-3); }
.commits li > form .btn:hover { color: var(--text); }
.commits .cm { grid-area: c; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; min-width: 0; font-size: 12px; line-height: 1.45; color: var(--text-3); }
.rb { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; color: var(--text-2); }
.rb svg.i { width: 13px; height: 13px; color: var(--text-3); }
.br {
  display: inline-block; min-width: 0; max-width: 100%; padding: 1px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border: 1px solid var(--line); border-radius: var(--r-s); background: color-mix(in srgb, var(--raised) 70%, transparent);
  font: 11.5px/1.45 var(--mono); color: var(--text-2);
}
.br:empty { display: none; }
.commits .by { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.commits .by .mk { width: 10px; height: 10px; }
.commits .by .mk.person::before, .commits .by .mk.agent::before { inset: 2px; }
/* unlinked: kept for the record, struck and folded away */
.unl { margin-top: 8px; }
.unl > summary {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; margin-left: -8px; padding: 0 9px 0 7px; border-radius: var(--r);
  list-style: none; cursor: pointer; font-size: 12.5px; color: var(--text-3); transition: background .1s linear, color .1s linear;
}
.unl > summary::-webkit-details-marker { display: none; }
.unl > summary svg.i { width: 14px; height: 14px; }
.unl > summary:hover, .unl[open] > summary { color: var(--text-2); }
.unl > summary:hover { background: var(--hover); }
.unl[open] > .commits { animation: ferr-in .2s var(--ease-out); }
.commits.off li { border-bottom-style: dashed; }
.commits.off li:last-child { border-bottom: 0; }
.commits.off .role { opacity: .6; }
.commits.off code.sha, .commits.off .ct { color: var(--text-3); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--text-3) 70%, transparent); }
.commits.off code.sha { background: transparent; border-style: dashed; }
.commits.off .rb { color: var(--text-3); }
.commits.off .by:last-child { flex-basis: 100%; color: var(--text-2); }

/* a take's repository and branch */
/* its line runs under the release button too: the column beside the button is too narrow for a branch */
.takes li { row-gap: 0; }
.takes li > div { display: contents; }
.takes li > .av { grid-row: 1 / span 2; }
.takes .nm { grid-column: 2; grid-row: 1; }
.takes .via { grid-column: 2; grid-row: 2; }
.takes li > form { grid-column: 3; grid-row: 1 / span 2; }
.takes .rb { grid-column: 2 / -1; grid-row: 3; display: flex; flex-wrap: wrap; row-gap: 4px; min-width: 0; overflow: hidden; margin-top: 6px; font-size: 12px; }

/* a switch: an admin's yes or no, said at once */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.switch-row .sw-text { min-width: 0; }
.switch-row .panel-h { margin-bottom: 6px; }
.switch {
  flex: none; gap: 10px; height: 32px; padding: 0 6px 0 10px; border-color: transparent; background: transparent; box-shadow: none;
  font-size: 13px; color: var(--text-2);
}
.switch:hover { background: var(--hover); border-color: transparent; }
.switch .track {
  position: relative; width: 34px; height: 20px; border-radius: 99px; flex: none;
  background: var(--seg-off); box-shadow: inset 0 0 0 1px var(--line-2); transition: background .18s var(--ease), box-shadow .18s var(--ease);
}
.switch .knob {
  position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-3);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .18s var(--ease), background .18s var(--ease);
}
.switch[aria-checked="true"] { color: var(--text); }
.switch[aria-checked="true"] .track { background: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.switch[aria-checked="true"] .knob { transform: translateX(14px); background: var(--bg); }
.switch:hover .track { box-shadow: inset 0 0 0 1px var(--text-3); }
.switch[aria-checked="true"]:hover .track { box-shadow: inset 0 0 0 1px var(--text), 0 0 0 3px color-mix(in srgb, var(--text) 10%, transparent); }

/* ---------- Older pages: the admin's, the account's, the sign-in card ---------- */
.page { width: 100%; max-width: 920px; padding: 32px 40px 72px; }
.page h1, .auth-card h1 { font-size: 22px; line-height: 1.25; letter-spacing: -.018em; font-weight: 600; margin-bottom: 14px; }
.page p:not(.ph-k) a:not(.btn), .page td a:not(.who), .page .meta a, .auth-card p a:not(.btn) { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.page p:not(.ph-k) a:not(.btn):hover, .page td a:not(.who):hover, .page .meta a:hover, .auth-card p a:not(.btn):hover { text-decoration-color: var(--text-2); }
.t2 { color: var(--text-2); } .t3 { color: var(--text-3); }
.page code.id { padding: 0; border: 0; font-size: 11.5px; color: var(--text-3); background: transparent; }

/* the page's head: its title, a line under it, its main act on the right */
.ph { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; }
.ph-t { flex: 1; min-width: 0; }
.ph h1 { display: flex; align-items: baseline; gap: 10px; margin: 0; overflow-wrap: anywhere; }
.ph h1 .n { font-size: 14px; font-weight: 500; color: var(--text-3); letter-spacing: 0; }
.ph-k { margin-bottom: 6px; font-size: 12.5px; }
.ph-k a { color: var(--text-3); transition: color .1s linear; }
.ph-k a:hover { color: var(--text); }
.ph-sub { margin-top: 6px; max-width: 62ch; color: var(--text-2); font-size: 13.5px; line-height: 1.55; }
.ph-a { display: flex; gap: 8px; flex: none; }
.ph-a .n { color: var(--text-3); font-weight: 400; }
.ph-who, .ph-t.ph-who { display: flex; align-items: center; gap: 16px; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 8px; font-size: 12.5px; color: var(--text-3); }
.av.lg { width: 48px; height: 48px; font-size: 16px; border-radius: 50%; box-shadow: var(--hi), var(--shadow-s); }
.pj.lg, .page td .pj {
  display: grid; place-items: center; flex: none; border: 1px solid var(--line-2); border-radius: 5px; font-weight: 700; color: var(--text-2); background: var(--panel);
}
.pj.lg { width: 48px; height: 48px; border-radius: 12px; font-size: 18px; box-shadow: var(--hi), var(--shadow-s); }
.pj.lg svg.i { width: 22px; height: 22px; }
.page td .pj { width: 20px; height: 20px; font-size: 10px; }

/* a table in its frame */
.tbl { margin: 0 0 24px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--panel); box-shadow: var(--hi), var(--shadow-s); overflow-x: auto; }
.page table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.page th { height: 36px; padding: 0 14px; text-align: left; font-size: 12px; font-weight: 500; color: var(--text-3); border-bottom: 1px solid var(--line); white-space: nowrap; }
.page td { height: 46px; padding: 6px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.page th.r, .page td.r { text-align: right; }
.page tr:last-child td { border-bottom: 0; }
.page tbody tr { transition: background .08s linear; }
.page tbody tr:hover { background: var(--hover); }
.page tr.off td > * { opacity: .55; }
.page td .who { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; color: var(--text); }
.page td .who svg.i { color: var(--text-3); }
.page td .who:hover .nm { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.page td .num { font-weight: 500; }
.tags { display: inline-flex; flex-wrap: wrap; gap: 4px; vertical-align: middle; }
.tag {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 99px;
  font-size: 12px; font-weight: 500; color: var(--text-2); white-space: nowrap;
}
.tag.on { color: var(--text); background: var(--raised); }
.live { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-2); }
.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--s-done); box-shadow: 0 0 0 3px color-mix(in srgb, var(--s-done) 16%, transparent); }
.live.off::before { background: var(--s-closed); box-shadow: none; }
code.remote { padding: 0; border: 0; background: none; font-size: 12.5px; color: var(--text-2); overflow-wrap: anywhere; }
/* the agents' accesses: a person's page, and a section of an admin's user page */
.grants-h { margin: 28px 0 14px; }
.grants .g-src { margin-left: 10px; font-size: 12px; }
.grants td.r form { display: inline-flex; }
.grants time { white-space: nowrap; }

/* the setup page for agents: the address, the sentence and the command to copy, then the steps */
.setup .panel-h { display: flex; align-items: center; gap: 10px; }
.setup .panel-h .tag { height: 20px; padding: 0 7px; font-size: 11.5px; color: var(--text-3); }
.setup .cmd + .hint { margin-top: 10px; }
.cmd {
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 6px 6px 12px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--raised); box-shadow: var(--hi);
}
.cmd code { flex: 1; min-width: 0; padding: 0; border: 0; background: none; font-size: 12.5px; line-height: 1.6; color: var(--text); overflow-wrap: anywhere; }
.cmd .pr { flex: none; align-self: flex-start; padding-top: 3px; font: 500 12.5px/1.6 var(--mono); color: var(--text-3); user-select: none; }
.cmd.say p { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.55; color: var(--text); overflow-wrap: anywhere; }
.cmd.say { border-left: 2px solid var(--line-2); }
.cmd .copy { flex: none; align-self: flex-start; }
.cmd .copy[hidden] { display: none; }
.cmd .copy.done, .cmd .copy.done svg.i { color: var(--s-done); }
.steps { list-style: none; padding: 0; counter-reset: step; display: flex; flex-direction: column; gap: 26px; }
.steps > li { position: relative; display: flex; flex-direction: column; gap: 10px; padding-left: 36px; counter-increment: step; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: -1px; display: grid; place-items: center; width: 22px; height: 22px;
  border: 1px solid var(--line-2); border-radius: 50%; background: var(--panel); box-shadow: var(--hi);
  font-size: 11.5px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums;
}
.steps > li:not(:last-child)::after { content: ""; position: absolute; left: 11px; top: 27px; bottom: -22px; width: 1px; background: var(--line); }
.steps h3 { font-size: 13.5px; font-weight: 600; line-height: 20px; letter-spacing: -.005em; }
.steps p.t2 { font-size: 13px; line-height: 1.5; }
.steps .cmd + p.t2 { margin-top: 4px; }
.seq { list-style: none; padding: 0; border: 1px solid var(--line); border-radius: var(--r); }
.seq li { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; min-height: 38px; padding: 6px 12px; font-size: 13px; color: var(--text-2); }
.seq li + li { border-top: 1px solid var(--line); }
.seq li::before { content: ""; flex: none; width: 5px; height: 5px; margin-right: 3px; border-right: 1.5px solid var(--text-3); border-bottom: 1.5px solid var(--text-3); transform: rotate(-45deg); }
.seq code { font-size: 12px; }
.act-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.expect { list-style: none; padding: 0; }
.expect li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; line-height: 1.5; color: var(--text-2); }
.expect li:first-child { padding-top: 0; }
.expect li:last-child { padding-bottom: 0; border-bottom: 0; }
.expect svg.i { margin-top: 2px; color: var(--text-3); }
.setup-other { max-width: 66ch; margin: 24px 2px 0; }
.setup-other h2 { margin-bottom: 4px; font-size: 12px; font-weight: 500; color: var(--text-3); }
.setup-other p { font-size: 13px; line-height: 1.55; color: var(--text-2); }

/* a panel: a form or a list in a frame */
.panel { margin: 0 0 16px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: var(--hi), var(--shadow-s); }
.panel-h { margin: 0 0 16px; font-size: 14px; font-weight: 600; letter-spacing: -.005em; }
.form { display: flex; flex-direction: column; gap: 18px; }
.form.narrow { max-width: 440px; }
.form.below { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.form .frow { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px; }
.form .f.grow { flex: 1 1 220px; }
.form .f.wide { flex: 2 1 320px; }
.form .f.end { align-self: flex-start; padding-top: 19px; }
.form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), .form select { height: 34px; width: 100%; }
.form input.key:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) { width: 15ch; text-transform: uppercase; letter-spacing: .04em; }
.form .hint, .page .hint { max-width: 52ch; margin: 0; font-size: 12px; line-height: 1.45; color: var(--text-3); }
.form-acts { display: flex; justify-content: flex-end; gap: 8px; padding-top: 2px; }
.form-acts .btn { height: 32px; padding: 0 14px; }
.inline { display: flex; gap: 8px; align-items: center; }
.inline input { flex: 1; min-width: 0; max-width: 320px; }
.checks { display: grid; gap: 8px; }
.check {
  display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 10px; padding: 11px 14px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r); transition: border-color .12s var(--ease), background .12s var(--ease);
}
.check:hover { border-color: var(--line-2); }
.check:has(input:checked) { border-color: var(--line-2); background: var(--raised); }
.check input { margin: 2px 0 0; }
.check > span { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--text-2); line-height: 1.45; }
.check b { font-weight: 500; color: var(--text); }
.act-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px 14px 22px; }
.act-row p { font-size: 13px; }
.rows { margin: 0; padding: 0; list-style: none; }
.rows li { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; min-height: 44px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.rows li:first-child { padding-top: 0; }
.rows li:last-child { border-bottom: 0; padding-bottom: 0; }
.rows .row-acts { display: flex; gap: 6px; margin-left: auto; }
.rows form { display: contents; }
.empty.sm { padding: 40px 24px 44px; margin-bottom: 16px; border: 1px dashed var(--line-2); border-radius: 12px; }
.empty .glyph { margin-bottom: 4px; }
.notice {
  display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: center; gap: 12px; margin-bottom: 16px; padding: 12px 14px 12px 16px;
  border: 1px solid var(--line-2); border-radius: var(--r-l); background: var(--raised); font-size: 13.5px; line-height: 1.5;
}
.notice svg.i { color: var(--text-2); align-self: start; margin-top: 2px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-top: 8px; }
.tile {
  display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--r-l);
  background: var(--panel); box-shadow: var(--hi), var(--shadow-s); font-weight: 500; transition: border-color .12s var(--ease), transform .12s var(--ease);
}
.tile svg.i { color: var(--text-3); }
.tile:hover { border-color: var(--line-2); transform: translateY(-1px); }

.auth {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 48px 16px;
  background:
    radial-gradient(900px 420px at 50% -12%, color-mix(in srgb, var(--text) 7%, transparent), transparent 70%),
    var(--bg);
}
.auth-card {
  width: min(400px, 100%); padding: 28px 28px 24px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--panel); box-shadow: var(--shadow), var(--hi);
  animation: rise-in .4s var(--ease-out) both;
}
@keyframes rise-in { from { opacity: 0; transform: translateY(8px); } }
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; font-weight: 600; font-size: 14px; }
.brand .site { margin-left: auto; font-weight: 400; font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.auth-card .alert { margin: 0 0 16px; }
.auth-card .glyph { margin-bottom: 16px; }
.auth-card p { margin: 0 0 14px; color: var(--text-2); line-height: 1.55; font-size: 13.5px; }
.auth-card p.note { font-size: 12.5px; color: var(--text-3); }
.auth-card label { color: var(--text-2); font-size: 12.5px; }
.auth-card label:has(> input:not([type="hidden"])) { display: flex; flex-direction: column; gap: 6px; font-weight: 500; } /* the field fills the card */
.auth-card input:not([type="hidden"]) { width: 100%; height: 36px; }
.auth-card p > button:only-child, .auth-card p > .btn:only-child { width: 100%; height: 36px; font-size: 13.5px; }
.auth-card h2 {
  display: flex; align-items: center; gap: 12px; margin: 22px 0 14px; font-size: 12px; font-weight: 500; color: var(--text-3);
}
.auth-card h2::before, .auth-card h2::after { content: ""; flex: 1; height: 1px; background: var(--line); }
/* the consent to an agent's client: two answers of the same width, the yes on the right */
.consent-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.consent-acts .btn { height: 36px; font-size: 13.5px; justify-content: center; }

/* ---------- Forms and admin ---------- */
/* a field: its label above, an error under it */
.f { display: flex; flex-direction: column; gap: 7px; min-width: 0; margin: 0; padding: 0; border: 0; }
.f-l { padding: 0; font-size: 12px; font-weight: 500; color: var(--text-3); }
.ferr { display: flex; align-items: flex-start; gap: 7px; margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--g-low); animation: ferr-in .2s var(--ease-out); }
.ferr::before { content: ""; width: 6px; height: 6px; margin-top: 5px; border-radius: 2px; background: var(--g-low); flex: none; }
@keyframes ferr-in { from { opacity: 0; transform: translateY(-2px); } }
:where(input, select, textarea)[aria-invalid="true"] { border-color: color-mix(in srgb, var(--g-low) 55%, var(--line-2)); }
.glyph {
  width: 44px; height: 44px; margin-bottom: 6px; display: grid; place-items: center; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--panel); box-shadow: var(--hi), var(--shadow-s); color: var(--text-3);
}
.glyph svg.i { width: 20px; height: 20px; }

/* segmented choices: radios, one row, the chosen one raised */
.seg { --track: var(--bg); --on: var(--sel); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: var(--r); background: var(--track); }
@media (prefers-color-scheme: light) { .seg { --track: var(--raised); --on: var(--panel); } }
.seg label { position: relative; display: flex; min-width: 0; cursor: pointer; }
.seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg label > span {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; height: 28px; padding: 0 4px;
  border-radius: 4px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background .12s var(--ease), color .12s var(--ease), box-shadow .12s var(--ease);
}
.seg label:hover > span { color: var(--text); }
.seg input:checked + span { background: var(--on); color: var(--text); font-weight: 500; box-shadow: var(--shadow-s), 0 0 0 1px var(--line-2); }
.seg input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 1px; }
.seg.prios label > span { flex-direction: column; gap: 5px; height: 48px; font-size: 12px; }
.seg.prios .prio { opacity: .7; transition: opacity .12s var(--ease); }
.seg.prios input:checked + span .prio, .seg.prios label:hover .prio { opacity: 1; }
fieldset.f[aria-invalid="true"] .seg { border-color: color-mix(in srgb, var(--g-low) 55%, var(--line-2)); }

/* a ticket's form: the text on the left, its properties on the right, as on the ticket's page */
.compose-form { display: flex; flex-direction: column; flex: 1; }
.compose { display: grid; flex: 1; grid-template-columns: minmax(0, 1fr) 320px; grid-template-rows: auto 1fr; grid-template-areas: "doc props" "foot props"; }
.compose-doc { grid-area: doc; display: flex; flex-direction: column; gap: 18px; width: 100%; max-width: 860px; padding: 36px 48px 0; }
.compose-h { display: flex; align-items: baseline; gap: 10px; font-size: 20px; line-height: 1.3; letter-spacing: -.015em; font-weight: 600; }
.compose-h .code { font-size: 15px; font-weight: 500; color: var(--text-3); letter-spacing: 0; }
.compose-card {
  display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--hi), var(--shadow-s); transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.compose-card:focus-within { border-color: var(--line-2); box-shadow: var(--hi), 0 0 0 3px color-mix(in srgb, var(--text) 7%, transparent), var(--shadow-s); }
.compose-card:has([aria-invalid="true"]) { border-color: color-mix(in srgb, var(--g-low) 45%, var(--line)); }
.compose-card .f { gap: 6px; padding: 14px 18px 16px; }
.compose-card .f + .f { border-top: 1px solid var(--line); }
.compose-card .f-title, .compose-card .f-desc {
  width: 100%; min-height: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: var(--text);
}
.compose-card .f-title:focus-visible, .compose-card .f-desc:focus-visible { box-shadow: none; }
.f-title { height: 34px; font-size: 21px; font-weight: 600; letter-spacing: -.015em; }
.f-desc { min-height: 300px; font-size: 14.5px; line-height: 1.65; }
.compose-props {
  grid-area: props; display: flex; flex-direction: column; gap: 22px; padding: 28px 24px 40px; border-left: 1px solid var(--line);
  background: linear-gradient(to bottom, color-mix(in srgb, var(--panel) 60%, transparent), transparent 480px);
}
.compose-props select { width: 100%; height: 34px; }
.f-static { display: flex; align-items: center; gap: 8px; height: 34px; font-size: 13.5px; font-weight: 500; }
.f-static .pj {
  width: 18px; height: 18px; border-radius: 4px; border: 1px solid var(--line-2); display: grid; place-items: center;
  font-size: 9.5px; font-weight: 700; color: var(--text-2);
}
.compose-foot { grid-area: foot; display: flex; justify-content: flex-end; align-items: start; gap: 8px; width: 100%; max-width: 860px; padding: 18px 48px 72px; }
.compose-foot .btn { height: 32px; padding: 0 14px; }

/* a ticket changed since its form was opened */
.conflict {
  display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 14px 12px 16px;
  border: 1px solid color-mix(in srgb, var(--s-prog) 40%, var(--line)); border-radius: var(--r-l);
  background: color-mix(in srgb, var(--s-prog) 8%, var(--panel)); font-size: 13.5px; line-height: 1.5;
}
.conflict svg.i { color: var(--s-prog); align-self: start; margin-top: 2px; }
.conflict p { color: var(--text); }

@media (max-width: 760px) {
  .compose { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "doc" "props" "foot"; align-content: start; }
  .compose-doc { padding: 20px 14px 0; gap: 14px; }
  .compose-h { font-size: 18px; }
  .compose-card .f { padding: 12px 14px 14px; }
  .f-title { font-size: 18px; }
  .f-desc { min-height: 220px; font-size: 16px; }
  .compose-props { padding: 24px 14px 8px; border-left: 0; background: none; }
  .compose-props select { height: 40px; font-size: 16px; }
  .seg label > span { height: 34px; font-size: 13px; }
  .seg.prios label > span { height: 52px; }
  .compose-foot {
    position: sticky; bottom: 0; z-index: 5; max-width: none; padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 86%, transparent);
    -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
  }
  .compose-foot .btn { flex: 1; height: 40px; font-size: 14px; }
  .conflict, .notice { grid-template-columns: 16px minmax(0, 1fr); }
  .conflict .btn, .notice .btn { grid-column: 2; justify-self: start; }
  .ph { flex-wrap: wrap; align-items: flex-start; }
  .ph h1 { font-size: 20px; }
  .av.lg, .pj.lg { width: 40px; height: 40px; }
  .panel { padding: 16px 14px; }
  .form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), .form select { height: 40px; font-size: 16px; }
  .form .f.end { padding-top: 0; }
  .form-acts .btn { flex: 1; height: 40px; }
  .inline { flex-wrap: wrap; }
  .inline input { max-width: none; flex-basis: 100%; }
  .act-row { flex-direction: column; align-items: stretch; }
  .switch-row { align-items: flex-start; gap: 12px; }
  .switch { height: 36px; margin: -8px -6px 0 0; }
}

/* ---------- Narrow windows: 360 to 760 px ---------- */
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side {
    position: fixed; z-index: 40; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); height: auto;
    transform: translateX(-102%); visibility: hidden; box-shadow: var(--shadow);
    transition: transform .26s var(--ease-out), visibility 0s linear .26s;
    view-transition-name: none;
  }
  .side:target { transform: none; visibility: visible; transition: transform .26s var(--ease-out); }
  .side-close { display: inline-flex; }
  .side:target ~ .scrim {
    display: block; position: fixed; inset: 0; z-index: 39; background: var(--scrim);
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); animation: fade-in .2s var(--ease) both;
  }
  .top { position: relative; flex-wrap: wrap; height: auto; min-height: var(--top-h); padding: 10px 12px 10px 8px; gap: 6px; }
  .top .menu { display: inline-flex; }
  .top .title { flex: 1; overflow: hidden; }
  .top h1.title { display: block; text-overflow: ellipsis; }
  .top .right { margin-left: 0; }
  .top .right .w { display: none; }
  .top .right .new { width: 30px; padding: 0; }
  .top .back { margin-left: 0; }
  .search { order: 5; flex: 1 0 100%; max-width: none; margin: 2px 4px 0; height: 36px; }
  .search input { font-size: 16px; }
  .search kbd { display: none; }
  .filters { padding: 8px 12px; }
  .filters .sort { display: none; }
  .filter-form { position: fixed; top: auto; left: 12px; right: 12px; bottom: 12px; min-width: 0; transform-origin: bottom center; }
  .filter-form label { grid-template-columns: 110px minmax(0, 1fr); }
  .filter-form select { font-size: 16px; }
  .grp { position: static; padding: 0 12px; }
  .row {
    grid-template-columns: 16px auto minmax(0, 1fr) auto;
    grid-template-areas: "p c . d" ". t t t" ". s g o";
    row-gap: 5px; column-gap: 10px; padding: 11px 12px; scroll-margin: 16px 0;
  }
  .row .t { white-space: normal; font-size: 14.5px; line-height: 1.38; }
  .row .g { justify-content: flex-end; }
  .keys { display: none; }
  .empty { padding: 56px 20px 64px; }

  .tk { display: flex; flex-direction: column; }
  .tk-doc { display: contents; }
  .tk > *, .tk-doc > * { padding-left: 18px; padding-right: 18px; }
  .tk-head { order: 1; padding-top: 20px; }
  .tk-title { font-size: 22px; margin-top: 8px; }
  .ladder { order: 2; margin-top: 20px; }
  .ladder .stp span { display: none; } /* the state pill below names the state */
  .stateline { order: 3; margin-top: 10px; flex-direction: column; align-items: flex-start; gap: 8px; }
  .card { order: 4; margin: 18px 18px 0; padding: 12px 14px 12px 16px; grid-template-columns: 16px minmax(0, 1fr); }
  .card > form { grid-column: 2; grid-row: auto; margin-top: 6px; }
  .card blockquote { font-size: 14.5px; }
  .card.prop > .card-acts { grid-column: 2; grid-row: auto; margin-top: 8px; }
  .card.prop > .card-acts .btn { height: 34px; padding: 0 14px; font-size: 13.5px; }
  .card.prop > .card-acts .btn.primary { flex: 1; }
  .desc { order: 5; margin-top: 24px; font-size: 15.5px; }
  .links { order: 5; margin-top: 30px; }
  .commits li { grid-template-columns: auto auto minmax(0, 1fr) auto; grid-template-areas: "r s . f" "t t t t" "c c c c"; column-gap: 8px; padding: 11px 0 12px; }
  .commits .ct { white-space: normal; overflow-wrap: anywhere; font-size: 14px; line-height: 1.4; margin-top: 2px; }
  .commits li > form .btn { height: 30px; margin-right: -8px; }
  .commits .cm { gap: 4px 12px; }
  .tk-props { order: 6; margin-top: 24px; padding-top: 22px; padding-bottom: 8px; gap: 22px; border-left: 0; border-top: 1px solid var(--line); background: none; }
  .why { order: 7; margin-top: 30px; }
  .hist { order: 8; margin-top: 30px; padding-bottom: 28px; }
  .legend { margin-left: 0; width: 100%; }
  .tl::before { left: calc(44px + 10px + 5.5px); top: 18px; }
  .tl li { grid-template-columns: 44px 12px minmax(0, 1fr); gap: 10px; align-items: start; }
  .tl .mk { margin-top: 3px; }
  .tl .to { grid-column: 3; }
  /* the acts stay at hand, at the bottom of the screen */
  .acts-row {
    order: 99; position: sticky; bottom: 0; z-index: 5; margin-top: 24px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    padding-top: 10px; padding-bottom: calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--panel) 88%, transparent);
    -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
  }
  .acts-row .btn { height: 36px; font-size: 13.5px; }
  .acts-row > form.sec { display: none; }
  .acts-row > form.lead { display: flex; flex: 1; min-width: 0; }
  .acts-row > form.lead .btn { flex: 1; justify-content: center; }
  .acts-row .more > .pop .narrow { display: block; }
  .acts-row .more { margin-left: auto; position: static; }
  .acts-row .more > .pop {
    position: fixed; top: auto; left: 10px; right: 10px; bottom: calc(64px + env(safe-area-inset-bottom));
    min-width: 0; max-height: 70vh; overflow-y: auto; transform-origin: bottom center;
  }
  .acts-row .more .sub :where(input, select, textarea) { font-size: 16px; }

  /* the board: one column at a time, swiped, its head kept */
  .top .seg a { padding: 0 7px; }
  .board { display: flex; scroll-snap-type: x mandatory; scroll-padding-inline: 0; scrollbar-width: none; }
  .col { display: flex; flex-direction: column; flex: 0 0 calc(100% - 36px); scroll-snap-align: start; }
  .col:last-child { flex-basis: 100%; }
  .col-h { padding: 12px 14px 10px; }
  .cards { gap: 8px; padding: 2px 10px 28px; }
  .kc { padding: 11px 12px; gap: 8px; }
  .kc .tt { font-size: 14.5px; -webkit-line-clamp: 5; line-clamp: 5; }
  .kc-m > summary { opacity: 1; width: 30px; height: 28px; }
  .kc-m[open]::before { content: ""; position: fixed; inset: 0; background: var(--scrim); animation: fade-in .2s var(--ease) both; }
  .kc-m > .pop, .col:first-child .kc-m > .pop {
    position: fixed; top: auto; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom));
    width: auto; margin: 0; max-height: 72vh; max-height: 72dvh; transform-origin: bottom center;
  }
  .kc-m .pop .item { height: 40px; font-size: 14px; }
  .kc-m .sub textarea { font-size: 16px; }
  .sheet { left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); width: auto; }
  .sheet textarea { font-size: 16px; }
  .board-foot { padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }

  .page { padding: 22px 14px 56px; }
  .page td, .page th { white-space: nowrap; }
  .auth-card { padding: 22px 18px 18px; }
  .auth-card input:not([type="hidden"]) { font-size: 16px; }
}
@keyframes fade-in { from { opacity: 0; } }

/* touch: no hover cues, no keyboard hints */
@media (hover: none) {
  .keys, .search kbd { display: none; }
  .kc-m > summary { opacity: 1; }
  .row:hover { background: transparent; }
}

/* ---------- Cross-document view transitions: list to ticket and back ---------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-group(*) { animation-duration: .32s; animation-timing-function: var(--ease-out); }
  ::view-transition-old(root) { animation: vt-out .16s var(--ease) both; }
  ::view-transition-new(root) { animation: vt-in .3s var(--ease-out) .04s both; }
  ::view-transition-old(tk-title), ::view-transition-new(tk-title),
  ::view-transition-old(tk-code), ::view-transition-new(tk-code) { height: 100%; animation-duration: .32s; }
  ::view-transition-old(side), ::view-transition-new(side) { animation: none; }
}
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------- Less motion when asked ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Print: the ticket on paper ---------- */
@media print {
  .side, .top, .acts-row, .scrim, .skip, .keys, .filters { display: none !important; }
  .app, .tk { display: block; }
}

/* ---- palette */
/* The command palette: a calm box over a dimmed page, one field, results grouped under small headings. */
.pal-open[hidden] { display: none; }
.btn.pal-open { gap: 7px; padding: 0 6px 0 9px; color: var(--text-3); }
.btn.pal-open svg.i { color: var(--text-3); }
.btn.pal-open:hover svg.i { color: var(--text); }
.pal-open kbd { padding: 2px 4px; border-bottom-width: 1px; background: transparent; }

html:has(dialog.pal[open]) { overflow: hidden; }
dialog.pal {
  position: fixed; inset: min(14vh, 132px) 0 auto; margin: 0 auto; padding: 0;
  width: min(640px, calc(100vw - 32px)); max-width: none;
  max-height: min(580px, calc(100dvh - min(14vh, 132px) - 24px));
  flex-direction: column; overflow: hidden;
  border: 1px solid var(--line-2); border-radius: 12px; color: var(--text);
  background: linear-gradient(to bottom, color-mix(in srgb, var(--text) 3%, transparent), transparent 56px), var(--panel);
  box-shadow: var(--shadow), var(--hi), 0 0 0 1px color-mix(in srgb, var(--bg) 40%, transparent);
}
dialog.pal[open] { display: flex; animation: pal-in .2s var(--ease-out) both; }
dialog.pal::backdrop {
  background: var(--scrim); -webkit-backdrop-filter: blur(3px) saturate(.9); backdrop-filter: blur(3px) saturate(.9);
  animation: fade-in .18s var(--ease) both;
}
@keyframes pal-in { from { opacity: 0; transform: translateY(-6px) scale(.985); } }
dialog.pal:focus-visible { outline: none; }

.pal-in { position: relative; display: flex; align-items: center; gap: 11px; flex: none; height: 54px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.pal-in[hidden] { display: none; }
.pal-in > svg.i { width: 17px; height: 17px; color: var(--text-3); }
.pal-in input, .pal-in input:hover, .pal-in input:focus-visible {
  flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none;
  font-size: 15.5px; color: var(--text); outline: none;
}
.pal-in input::placeholder { color: var(--text-3); }
.pal-ctx { flex: none; padding: 3px 7px; border: 1px solid var(--line-2); border-radius: var(--r-s); font-size: 12px; font-weight: 500; color: var(--text-2); font-variant-numeric: tabular-nums; }
/* a hairline that runs under the field while the server is asked, after a short wait */
.pal-busy { position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; overflow: hidden; opacity: 0; transition: opacity .2s var(--ease); }
.pal-busy::after { content: ""; position: absolute; top: 0; bottom: 0; width: 38%; background: linear-gradient(90deg, transparent, var(--text-2), transparent); animation: pal-run 1s var(--ease) infinite; }
dialog.pal.busy .pal-busy { opacity: 1; }
@keyframes pal-run { from { transform: translateX(-100%); } to { transform: translateX(270%); } }

.pal-res { position: relative; flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 4px 6px 6px; scrollbar-width: thin; }
.pal-res[hidden] { display: none; }
.pal-g + .pal-g { margin-top: 4px; }
.pal-h { margin: 8px 10px 4px; font-size: 11.5px; font-weight: 500; letter-spacing: .01em; color: var(--text-3); }
.pal-it {
  display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 10px; border-radius: var(--r);
  font-size: 13.5px; color: var(--text-2); cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
}
.pal-it > svg.i { color: var(--text-3); }
.pal-it .pj { display: grid; place-items: center; flex: none; width: 16px; height: 16px; border: 1px solid var(--line-2); border-radius: 4px; font-size: 9px; font-weight: 700; color: var(--text-2); }
.pal-it .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.pal-it .code { flex: none; min-width: 58px; font-size: 12.5px; }
.pal-it .pal-st { flex: none; font-size: 12px; color: var(--text-3); }
.pal-it .lad { flex: none; }
.pal-go { display: inline-flex; flex: none; width: 16px; color: var(--text-3); opacity: 0; transform: translateX(-3px); transition: opacity .12s var(--ease), transform .16s var(--ease-out); }
.pal-it[aria-selected="true"] { background: var(--sel); box-shadow: var(--hi); }
.pal-it[aria-selected="true"] > svg.i { color: var(--text); }
.pal-it[aria-selected="true"] .pal-go { opacity: 1; transform: none; }
.pal-it.danger > svg.i { color: var(--g-low); }
.pal-it.going { animation: pal-going .5s var(--ease) infinite alternate; }
@keyframes pal-going { to { opacity: .55; } }
.pal-it mark { color: var(--text); background: color-mix(in srgb, var(--text) 13%, transparent); border-radius: 3px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 13%, transparent); }
.pal-it .code mark { color: var(--text); }

.pal-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 34px 16px 36px; text-align: center; color: var(--text-2); font-size: 13.5px; }
.pal-empty svg.i { width: 22px; height: 22px; margin-bottom: 4px; color: var(--text-3); stroke-width: 1.3; }
.pal-empty .pal-hint { font-size: 12.5px; color: var(--text-3); }

/* an act that asks for more: its own fields, in the box */
.pal-step { padding: 16px 16px 14px; animation: pal-step .18s var(--ease-out) both; }
.pal-step[hidden] { display: none; }
@keyframes pal-step { from { opacity: 0; transform: translateX(8px); } }
.pal-form { display: flex; flex-direction: column; gap: 12px; }
.pal-form .pal-fh { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 600; }
.pal-form .pal-fh svg.i { color: var(--text-3); }
.pal-form .pal-fh .code { margin-left: auto; font-size: 12px; font-weight: 500; }
.pal-form label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--text-2); }
.pal-form :where(input:not([type="hidden"]), select, textarea) { width: 100%; }
.pal-form textarea { min-height: 76px; }
.pal-fa { display: flex; justify-content: flex-end; gap: 8px; margin-top: 2px; }

.pal-cmds { display: none; }
.pal-ft { display: flex; gap: 18px; flex: none; padding: 9px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-3); }
.pal-ft > span { display: inline-flex; align-items: center; gap: 6px; }
.pal-ft kbd { min-width: 17px; padding: 2px 4px; font-size: 10.5px; }
.pal-k-back, dialog.pal.stepped .pal-k-close, dialog.pal.stepped .pal-k-list { display: none; }
dialog.pal.stepped .pal-k-back { display: inline; }

@media (max-width: 760px) {
  .btn.pal-open { width: 30px; padding: 0; }
  .pal-open kbd { display: none; }
  dialog.pal {
    inset: calc(8px + env(safe-area-inset-top)) 0 auto; width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px - env(safe-area-inset-top)); border-radius: 14px;
  }
  .pal-in input, .pal-in input:hover, .pal-in input:focus-visible { font-size: 16px; }
  .pal-it { height: 44px; font-size: 14.5px; }
  .pal-it .pal-st { display: none; }
  .pal-step .pal-fa .btn { height: 36px; padding: 0 14px; }
}
@media (hover: none) and (pointer: coarse) {
  .pal-ft { display: none; }
}
