/* The kit: every shared piece of a screen. Uses only tokens.css.
   A piece is flat: grounds, space and one hairline part things; only
   controls carry a ring; only floating surfaces carry a shadow.
   The kit draws every control itself; nothing is left to the browser. */

/* Where the pointer is, measured from the piece that catches its light, and
   how much of that light is showing (0 with no pointer, 1 with one). */
@property --px { syntax: "<length>"; inherits: false; initial-value: -999px; }
@property --py { syntax: "<length>"; inherits: false; initial-value: -999px; }
@property --lit { syntax: "<number>"; inherits: true; initial-value: 0; }
/* The pointer's light as one piece draws it. It is that piece's own and is never handed down. */
@property --shine { syntax: "*"; inherits: false; }
/* How much of a notice's time is left. */
@property --left { syntax: "<percentage>"; inherits: false; initial-value: 100%; }

*, *::before, *::after { box-sizing: border-box; }
.db [hidden] { display: none !important; }
.db { background: var(--g0); color: var(--ink); font-family: var(--font-text); font-size: var(--fs-body); line-height: 1.5; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; caret-color: var(--live); transition: --lit var(--dur-420) var(--ease); }
.db ::selection { background: color-mix(in srgb, var(--live) 30%, transparent); }
.db :focus-visible { outline: none; }
.db :focus-visible:not(.db-menu, .db-sheet, .db-tray) { box-shadow: var(--focus); }
/* A part in another colourway writes in that colourway's ink */
.db [data-colourway] { color: var(--ink); }
/* Nothing shows a browser's own look. A link is written in the words' own colour over a hairline, and turns live under
   the pointer; an anchor that carries a piece's class looks as that piece does. A bare button, list, rule, table and
   folding line start plain, and a bare field, tick box and round choice are drawn as the kit's. */
:where(.db) a { color: inherit; text-decoration: none; }
:where(.db) a:not([class]) { border-radius: var(--radius-3); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--ink4); cursor: pointer; transition: color var(--dur-140) var(--ease), text-decoration-color var(--dur-140) var(--ease); }
:where(.db) a:not([class]):hover { color: var(--live-text); text-decoration-color: currentColor; }
:where(.db) button { margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
:where(.db) :is(ul, ol) { margin: 0; padding-left: var(--space-20); }
:where(.db) li::marker { color: var(--ink3); }
:where(.db) hr { height: 1px; margin: var(--space-16) 0; border: 0; background: var(--hair); }
:where(.db) table { border-collapse: collapse; border-spacing: 0; font-variant-numeric: tabular-nums; }
:where(.db) :is(th, td) { padding: var(--space-8) var(--space-12); text-align: left; font-weight: 400; }
:where(.db) th { font-size: var(--fs-label); color: var(--ink3); }
:where(.db) tr + tr > td { box-shadow: inset 0 1px 0 var(--hair); }
:where(.db) summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: var(--space-8); }
:where(.db) summary::-webkit-details-marker { display: none; }
:where(.db) summary::before { content: ""; flex: none; width: 6px; height: 6px; margin: 0 3px 0 1px; border-right: 1.5px solid var(--ink3); border-bottom: 1.5px solid var(--ink3); transform: rotate(-45deg); transition: transform var(--dur-240) var(--ease-settle); }
:where(.db) details[open] > summary::before { transform: translateY(-2px) rotate(45deg); }
.db-title-l { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-title-l); line-height: 1.1; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
.db-title-s { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-title-s); line-height: 1.2; letter-spacing: -0.01em; margin: 0; text-wrap: balance; }
.db-lead { font-size: var(--fs-lead); color: var(--ink2); margin: 0; }
.db-label { font-size: var(--fs-label); color: var(--ink3); }
.db-num { font-variant-numeric: tabular-nums; }
.db-muted { color: var(--ink3); }

/* Scrollbars: a thin thumb and no track, on the page and inside every piece */
@supports not selector(::-webkit-scrollbar) { * { scrollbar-width: thin; scrollbar-color: var(--ink4) transparent; } }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-thumb { border: 4px solid transparent; border-radius: var(--radius-pill); background: var(--ink4) content-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--ink3); }
::-webkit-scrollbar-corner { background: none; }

/* Shell: side rail, top bar with the loading light, the page */
.db-shell { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: 100%; }
.db-rail { --ground: var(--g1); background: var(--ground); display: flex; flex-direction: column; align-items: center; gap: var(--space-6); padding-block: var(--space-12); }
.db-rail-btn { width: 36px; height: 36px; border-radius: var(--radius-8); display: grid; place-items: center; color: var(--ink3); background: none; border: 0; cursor: pointer; transition: background var(--dur-140) var(--ease), color var(--dur-140) var(--ease); }
.db-rail-btn:hover { background: var(--g-hover); color: var(--ink); }
.db-rail-btn[aria-current="page"] { background: var(--g-press); color: var(--ink); }
.db-rail-btn svg { transform: scale(calc(1 + var(--near, 0) * 0.24)); transition: transform var(--dur-240) var(--ease); }
.db-rail-foot { margin-top: auto; }
.db-top { position: relative; height: var(--top); display: flex; align-items: center; gap: var(--space-16); padding-inline: var(--space-24); box-shadow: inset 0 -1px 0 var(--hair); }
.db-top-name { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-lead); }
.db-top-end { margin-left: auto; display: flex; align-items: center; gap: var(--space-8); }
.db-page { padding: var(--space-24); display: flex; flex-direction: column; gap: var(--space-24); min-width: 0; }

/* The loading light: one line of light crossing under the top bar while a page or a part loads */
.db-light { position: absolute; inset: auto 0 -1px 0; height: 2px; overflow: hidden; opacity: 0; transition: opacity var(--dur-240) var(--ease); pointer-events: none; }
.db-light::before { content: ""; position: absolute; top: 0; bottom: 0; width: 28%; left: -28%;
  background: linear-gradient(90deg, transparent, var(--live) 45%, var(--light-core) 78%, var(--live) 92%, transparent);
  filter: drop-shadow(0 0 6px var(--live)); }
.db-light[data-on] { opacity: 1; }
.db-light[data-on]::before { animation: db-streak 1100ms var(--ease-through) infinite; }
@keyframes db-streak { to { left: 100%; } }

/* Skeleton: the shape of what is coming, with one band of light crossing the whole
   screen the way the loading light does. It outranks every piece's own colours,
   at once and without a fade, so nothing stays readable under it. */
.db-skel.db-skel { border-radius: var(--radius-6); user-select: none; pointer-events: none; transition: none !important;
  color: transparent !important; box-shadow: none !important; background-color: transparent !important;
  background-image: linear-gradient(100deg, var(--skel) 35%, var(--skel-lit) 50%, var(--skel) 65%) !important;
  background-size: 220vw 100% !important; background-attachment: fixed !important; background-position: -143vw 0;
  animation: db-shimmer 1500ms linear infinite; }
.db-skel.db-skel *, .db-skel.db-skel::before, .db-skel.db-skel::after { visibility: hidden !important; }
.db-skel.db-skel::placeholder { color: transparent !important; }
@keyframes db-shimmer { to { background-position-x: 23vw; } }

/* Buttons */
.db-btn { height: var(--h-32); padding-inline: var(--space-12); border: 0; border-radius: var(--radius-8); font: inherit; font-weight: 500; color: var(--ink); background: transparent; box-shadow: var(--ring); cursor: pointer; display: inline-flex; align-items: center; gap: var(--space-8); white-space: nowrap;
  transition: background var(--dur-140) var(--ease), box-shadow var(--dur-140) var(--ease), transform var(--dur-90) var(--ease), color var(--dur-140) var(--ease); }
.db-btn:hover { box-shadow: var(--ring-hover); background: var(--g-hover); }
.db-btn:active { transform: scale(0.97); background: var(--g-press); }
.db-btn--solid { background: var(--solid); color: var(--onsolid); box-shadow: none; }
.db-btn--solid:hover { background: color-mix(in srgb, var(--solid) 88%, var(--g0)); box-shadow: none; }
.db-btn--quiet { box-shadow: none; color: var(--ink2); }
.db-btn--quiet:hover { box-shadow: none; color: var(--ink); }
.db-btn--bad { color: var(--bad-text); }
.db-btn--bad:hover { background: var(--bad-wash); box-shadow: inset 0 0 0 1px var(--bad); }
.db-btn--sm { height: var(--h-28); padding-inline: var(--space-10); font-size: var(--fs-label); }
.db-btn[disabled], .db-btn[aria-disabled="true"] { opacity: var(--op-disabled); pointer-events: none; }
.db-btn[data-busy] { color: transparent; position: relative; pointer-events: none; }
/* Something to click that is not ready yet: the button is disabled, and the piece around it (.db-notyet, which the keys
   can reach) says why (data-why) while the pointer is on it or the keys are */
.db-notyet { position: relative; display: inline-flex; border-radius: var(--radius-8); cursor: not-allowed; }
.db .db-notyet:focus-visible { box-shadow: var(--focus); }
.db-notyet::after { content: attr(data-why); position: absolute; left: 0; bottom: calc(100% + var(--space-6)); z-index: 2; width: max-content; max-width: 260px; padding: var(--space-6) var(--space-10); border-radius: var(--radius-8); background: var(--g3); box-shadow: var(--depth-2); color: var(--ink); font-size: var(--fs-label); line-height: 1.4; white-space: normal; opacity: 0; transform: translateY(2px); pointer-events: none; transition: opacity var(--dur-140) var(--ease), transform var(--dur-140) var(--ease); }
.db-notyet:is(:hover, :focus)::after { opacity: 1; transform: none; }
.db-btn[data-busy]::after { content: ""; position: absolute; inset: 0; margin: auto; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink3); border-top-color: var(--ink); animation: db-turn 700ms linear infinite; }
.db-btn--solid[data-busy]::after { border-color: color-mix(in srgb, var(--onsolid) 40%, transparent); border-top-color: var(--onsolid); }
@keyframes db-turn { to { transform: rotate(1turn); } }

/* Round button: a mark alone, for the controls beside a tray and the months of a calendar */
.db-round { width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; flex: none; background: none; color: var(--ink2); cursor: pointer; transition: background var(--dur-140) var(--ease), color var(--dur-140) var(--ease), transform var(--dur-90) var(--ease); }
.db-round:hover { background: var(--g-hover); color: var(--ink); }
.db-round:active { transform: scale(0.94); background: var(--g-press); }
.db-round[aria-pressed="true"] { background: var(--live-wash); color: var(--live-text); }
.db-round[disabled] { opacity: var(--op-disabled); pointer-events: none; }
.db-round--sm { width: var(--h-28); height: var(--h-28); }
/* A button clicked to fold a part points up while the part is open and down while it is folded */
.db-round[data-db-fold] > .db-mark { transition: transform var(--dur-240) var(--ease-settle); }
.db-round[data-db-fold][aria-expanded="false"] > .db-mark { transform: rotate(180deg); }
/* A mark: drawn by the kit from its name, in the colour of the words beside it */
.db-mark { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* Fields */
.db-field { display: flex; flex-direction: column; gap: var(--space-6); min-width: 0; }
.db-input, .db-pick-btn, .db-date-btn, :where(.db) :is(input, textarea, select):not([class], [type="checkbox"], [type="radio"], [type="hidden"], [type="file"], [type="range"], [type="color"], [type="submit"], [type="button"], [type="reset"], [type="image"]) { height: var(--h-36); width: 100%; padding-inline: var(--space-12); border: 0; border-radius: var(--radius-8); background: var(--g2); color: var(--ink); font: inherit; appearance: none; box-shadow: var(--ring-soft); transition: box-shadow var(--dur-140) var(--ease), background var(--dur-140) var(--ease); }
.db-input:hover, .db-pick-btn:hover, .db-date-btn:hover, :where(.db) :is(input, textarea, select):not([class], [type="checkbox"], [type="radio"], [type="hidden"], [type="file"], [type="range"], [type="color"], [type="submit"], [type="button"], [type="reset"], [type="image"]):hover { box-shadow: var(--ring); }
.db .db-input:focus, .db :is(input, textarea, select):not([class], [type="checkbox"], [type="radio"], [type="hidden"], [type="file"], [type="range"], [type="color"], [type="submit"], [type="button"], [type="reset"], [type="image"]):focus, .db .db-pick-btn:focus-visible, .db .db-date-btn:focus-visible, .db .db-pick-btn[aria-expanded="true"], .db .db-date-btn[aria-expanded="true"] { outline: none; box-shadow: var(--ring-field), var(--focus); background: var(--g3); }
.db-input::placeholder, :where(.db) :is(input, textarea)::placeholder { color: var(--ink3); opacity: 1; }

.db-input:-webkit-autofill { -webkit-text-fill-color: var(--ink); box-shadow: var(--ring-soft), inset 0 0 0 100px var(--g2); }

/* Search field: its own mark, and its own control to clear what is typed */
.db-search { position: relative; display: flex; align-items: center; min-width: 0; }
.db-search::before { content: ""; position: absolute; left: var(--space-12); top: 50%; width: 11px; height: 11px; margin-top: -7px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--ink3); pointer-events: none; }
.db-search::after { content: ""; position: absolute; left: 21px; top: 50%; width: 5px; height: 1.5px; margin-top: 2px; border-radius: 1px; background: var(--ink3); transform: rotate(45deg); transform-origin: left center; pointer-events: none; }
.db-search .db-input { padding-inline: var(--space-32); }
.db-search .db-input::-webkit-search-cancel-button, .db-search .db-input::-webkit-search-decoration { display: none; }
.db-search-clear, .db-clear { position: absolute; right: var(--space-8); width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: var(--g-press); cursor: pointer; transition: background var(--dur-140) var(--ease); }
.db-search-clear:hover, .db-clear:hover { background: var(--ink4); }
.db-search-clear::before, .db-search-clear::after, .db-clear::before, .db-clear::after { content: ""; position: absolute; left: 50%; top: 50%; width: 9px; height: 1.5px; margin: -0.75px 0 0 -4.5px; border-radius: 1px; background: var(--ink2); transform: rotate(45deg); }
.db-search-clear::after, .db-clear::after { transform: rotate(-45deg); }
.db-search .db-input:placeholder-shown + .db-search-clear { display: none; }

/* Pick list and date field: a button that shows the value and opens its list or
   calendar on the menu surface */
.db-pick, .db-date { position: relative; min-width: 0; }
/* A field that may be left empty: its clear control stands in the field, before the mark at its end, while it holds something */
.db-clear { top: calc((var(--h-36) - 20px) / 2); right: var(--space-32); }
:is(.db-pick, .db-date):has(> .db-clear:not([hidden])) .db-pick-value { margin-right: var(--space-24); }
.db-pick-btn, .db-date-btn { display: flex; align-items: center; gap: var(--space-8); text-align: left; cursor: pointer; }
.db-pick-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-pick-value:empty::before { content: attr(data-placeholder); color: var(--ink3); }
.db-pick-btn::after { content: ""; flex: none; width: 7px; height: 7px; margin-right: 2px; border-right: 1.5px solid var(--ink3); border-bottom: 1.5px solid var(--ink3); transform: translateY(-2px) rotate(45deg); transition: transform var(--dur-240) var(--ease-settle); }
.db-pick-btn[aria-expanded="true"]::after { transform: translateY(2px) rotate(225deg); }
.db-date-btn::after { content: ""; flex: none; width: 14px; height: 13px; border-radius: var(--radius-3); background: linear-gradient(var(--ink3), var(--ink3)) 50% 4px / 8px 1.5px no-repeat; box-shadow: inset 0 0 0 1.5px var(--ink3); }
.db-menu.db-pick-list { max-height: min(300px, var(--room, 300px)); }
.db .db-menu > button[aria-selected="true"] { font-weight: 500; }
.db-menu > button[aria-selected="true"]::after { content: ""; flex: none; width: 10px; height: 6px; margin-left: auto; border-left: 2px solid var(--live); border-bottom: 2px solid var(--live); transform: translateY(-2px) rotate(-45deg); }

/* Calendar: one month, today marked, the chosen day lit */
.db-menu.db-cal { min-width: 0; padding: var(--space-12); }
.db-cal-head { display: flex; align-items: center; gap: 2px; padding-left: var(--space-8); margin-bottom: var(--space-4); }
.db-cal-month { flex: 1; font-weight: 600; }
.db-cal-head .db-round { width: var(--h-28); height: var(--h-28); }
.db-cal-head .db-round::before { content: ""; width: 7px; height: 7px; border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateX(1.5px) rotate(45deg); }
.db-cal-head .db-round[data-cal-step="1"]::before { transform: translateX(-1.5px) rotate(225deg); }
.db-cal-days, .db-cal-grid { display: grid; grid-template-columns: repeat(7, var(--h-36)); }
.db-cal-days span { height: var(--h-28); display: grid; place-items: center; font-size: var(--fs-label); color: var(--ink3); }
.db-cal-grid[data-dir="1"] { animation: db-cal-next var(--dur-240) var(--ease); }
.db-cal-grid[data-dir="-1"] { animation: db-cal-prev var(--dur-240) var(--ease); }
@keyframes db-cal-next { from { opacity: 0; transform: translateX(10px); } }
@keyframes db-cal-prev { from { opacity: 0; transform: translateX(-10px); } }
.db-cal-day { position: relative; height: var(--h-36); padding: 0; border: 0; border-radius: var(--radius-8); background: none; color: var(--ink); font: inherit; font-variant-numeric: tabular-nums; cursor: pointer; transition: background var(--dur-140) var(--ease); }
.db-cal-day:hover { background: var(--g-hover); }
.db-cal-day[data-out] { color: var(--ink3); }
.db-cal-day:disabled { color: var(--ink4); cursor: default; background: none; }
/* The line a day or a time is typed in lies over the field for as long as it is being typed */
.db-type-line { position: absolute; top: 0; left: 0; z-index: 1; }
.db-cal-day[aria-current="date"] { font-weight: 600; }
.db-cal-day[aria-current="date"]::after { content: ""; position: absolute; left: 50%; bottom: 5px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; }
.db-cal-day[aria-pressed="true"] { background: var(--live); color: var(--on-signal); font-weight: 600; }
.db-cal-foot { display: flex; justify-content: space-between; margin-top: var(--space-8); padding-top: var(--space-8); box-shadow: inset 0 1px 0 var(--hair); }

/* Switches */
.db-toggle { appearance: none; width: 38px; height: 22px; border-radius: var(--radius-pill); background: var(--ink4); position: relative; cursor: pointer; flex: none; transition: background var(--dur-240) var(--ease); }
.db-toggle::before { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--g3); box-shadow: var(--depth-1); transition: transform var(--dur-240) var(--ease-settle); }
.db-toggle:checked { background: var(--live); }
.db-toggle:checked::before { transform: translateX(16px); background: #fff; }
/* On a state ground the switch is drawn in the ground's ink, so its knob takes the ground's colour */
.db [data-ground] .db-toggle:checked::before { background: var(--ground); }
.db-check, :where(.db) input:is([type="checkbox"], [type="radio"]):not([class]) { appearance: none; margin: 0; width: 18px; height: 18px; border-radius: 5px; box-shadow: var(--ring); cursor: pointer; flex: none; display: grid; place-items: center; transition: background var(--dur-140) var(--ease), box-shadow var(--dur-140) var(--ease); }
.db-check::before, :where(.db) input[type="checkbox"]:not([class])::before { content: ""; width: 9px; height: 5px; border-left: 2px solid var(--on-mark); border-bottom: 2px solid var(--on-mark); transform: rotate(-45deg) scale(0); translate: 0 -1px; transition: transform var(--dur-240) var(--ease-settle); }
.db-check:checked, :where(.db) input[type="checkbox"]:not([class]):checked { background: var(--on-fill); box-shadow: none; }
.db-check:checked::before, :where(.db) input[type="checkbox"]:not([class]):checked::before { transform: rotate(-45deg) scale(1); }
:where(.db) input[type="radio"]:not([class]) { border-radius: 50%; }
:where(.db) input[type="radio"]:not([class])::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--on-fill); transform: scale(0); transition: transform var(--dur-240) var(--ease-settle); }
:where(.db) input[type="radio"]:not([class]):checked { box-shadow: inset 0 0 0 1.5px var(--on-fill); }
:where(.db) input[type="radio"]:not([class]):checked::before { transform: scale(1); }
.db-seg { display: inline-flex; padding: 3px; border-radius: var(--radius-8); background: var(--g2); gap: 2px; }
.db-seg button { height: var(--h-28); padding-inline: var(--space-12); border: 0; border-radius: var(--radius-6); background: none; color: var(--ink3); font: inherit; font-size: var(--fs-label); font-weight: 500; cursor: pointer; transition: color var(--dur-140) var(--ease), background var(--dur-140) var(--ease); }
.db-seg button:hover { color: var(--ink); }
.db-seg button[aria-pressed="true"] { background: var(--g3); color: var(--ink); box-shadow: var(--depth-1); }

/* Status mark: a symbol and a colour, in the same place on every line */
.db-status { display: inline-flex; align-items: center; gap: var(--space-8); font-size: var(--fs-label); font-weight: 500; white-space: nowrap; color: var(--ink2); }
.db-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink4); flex: none; }
.db-status[data-is="live"] { color: var(--live-text); }
.db-status[data-is="live"]::before { background: var(--live); box-shadow: 0 0 0 3px var(--live-wash); animation: db-pulse 2200ms var(--ease) infinite; }
.db-status[data-is="wait"] { color: var(--wait-text); }
.db-status[data-is="wait"]::before { background: none; box-shadow: inset 0 0 0 2px var(--wait); }
.db-status[data-is="bad"] { color: var(--bad-text); }
.db-status[data-is="bad"]::before { background: var(--bad); border-radius: 2px; transform: rotate(45deg); }
.db-status[data-is="ok"] { color: var(--ok-text); }
.db-status[data-is="ok"]::before { background: var(--ok); }
.db-status[data-is="off"]::before { background: none; box-shadow: inset 0 0 0 1.5px var(--ink4); }
@keyframes db-pulse { 50% { box-shadow: 0 0 0 6px transparent; } }

/* Chip: one thing of the model, named, with the colour of its kind */
.db-chip { --k: var(--ink3); display: inline-flex; align-items: center; gap: var(--space-6); height: var(--h-24); padding-inline: var(--space-8); border-radius: var(--radius-6); font-size: var(--fs-label); font-weight: 500; color: var(--ink); background: color-mix(in srgb, var(--k) 15%, transparent); white-space: nowrap; }
.db-chip::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: var(--k); }
/* Kinds: a piece marked data-kind takes that kind's colour as --k, and draws with --k. One line for each kind. */
[data-kind="1"] { --k: var(--hue-1); }
[data-kind="2"] { --k: var(--hue-2); }
[data-kind="3"] { --k: var(--hue-3); }
[data-kind="4"] { --k: var(--hue-4); }
[data-kind="5"] { --k: var(--hue-5); }
[data-kind="6"] { --k: var(--hue-6); }
[data-kind="7"] { --k: var(--hue-7); }

/* Tabs: underlined words; the line slides to the tab that is open */
.db-tabs { position: relative; display: flex; gap: var(--space-24); box-shadow: inset 0 -1px 0 var(--hair); }
.db-tab { height: 40px; padding: 0; border: 0; background: none; font: inherit; font-weight: 500; color: var(--ink3); cursor: pointer; transition: color var(--dur-140) var(--ease); display: inline-flex; align-items: center; gap: var(--space-8); }
.db-tab:hover { color: var(--ink); }
.db-tab[aria-selected="true"] { color: var(--ink); }
.db-tab .db-num { font-size: var(--fs-label); color: var(--ink3); }
.db-tabs-line { position: absolute; bottom: 0; left: 0; height: 2px; width: var(--w, 0); transform: translateX(var(--x, 0)); background: var(--ink); border-radius: 2px; transition: transform var(--dur-240) var(--ease-settle), width var(--dur-240) var(--ease-settle); }

/* Figures: the few numbers a screen is about */
.db-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--space-32); }
.db-figure { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-4); min-width: 0; }
.db-figure-n { font-size: var(--fs-figure); font-weight: 500; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -0.025em; }
.db-figure-n small { font-size: var(--fs-body); color: var(--ink3); font-weight: 400; margin-left: 2px; letter-spacing: 0; }
.db-delta { font-size: var(--fs-label); font-variant-numeric: tabular-nums; }
.db-delta[data-dir="up"] { color: var(--ok-text); } .db-delta[data-dir="down"] { color: var(--bad-text); }
.db-spark { width: 100%; height: 34px; display: block; overflow: visible; }
.db-spark path { vector-effect: non-scaling-stroke; fill: none; stroke: var(--live); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.db-spark path.db-spark-fill { stroke: none; fill: var(--live-wash); }
/* A piece that shows an amount takes it from data-v (0 to 100) and its colour from data-is */
.db-meter, .db-ring, .db-days, .db-datetile[data-is="live"] { --c: var(--live); }
:is(.db-meter, .db-ring, .db-days, .db-datetile)[data-is="ok"] { --c: var(--ok); }
:is(.db-meter, .db-ring, .db-days, .db-datetile)[data-is="wait"] { --c: var(--wait); }
:is(.db-meter, .db-ring, .db-days, .db-datetile)[data-is="bad"] { --c: var(--bad); }
.db-meter { align-self: stretch; height: 6px; border-radius: var(--radius-pill); background: var(--g-press); overflow: hidden; }
.db-meter > i { display: block; height: 100%; width: calc(var(--v, 0) * 1%); border-radius: inherit; background: var(--c); transition: width var(--dur-420) var(--ease); }
/* A lit meter: the bar glows, and brightens toward its leading end */
.db-meter[data-lit] { height: 10px; overflow: visible; }
.db-meter[data-lit] > i { background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 68%, var(--light-core))); box-shadow: 0 0 18px -2px color-mix(in srgb, var(--c) var(--glow), transparent), 0 5px 14px -5px color-mix(in srgb, var(--c) var(--glow), transparent); }
/* Ring gauge: the amount as an arc, its number inside */
.db-ring { position: relative; width: 52px; height: 52px; flex: none; display: inline-grid; place-items: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.db-ring--lg { width: 104px; height: 104px; font-family: var(--font-display); font-size: var(--fs-title-s); }
.db-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; transform: rotate(-90deg); }
.db-ring circle { fill: none; stroke: var(--g-press); stroke-width: 5; }
.db-ring circle + circle { stroke: var(--c); stroke-linecap: round; stroke-dasharray: var(--v, 0) 100; filter: drop-shadow(0 0 4px color-mix(in srgb, var(--c) var(--glow), transparent)); transition: stroke-dasharray var(--dur-420) var(--ease); }
/* Money: the unit and the cents set small beside the amount; a change marker says which way it moved */
.db-money { display: inline-flex; align-items: flex-start; font-size: var(--fs-figure); font-weight: 500; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -0.025em; }
.db-money small { margin-top: 3px; font-size: var(--fs-body); line-height: 1.2; letter-spacing: 0; color: var(--ink2); }
.db-money small:first-child { margin-right: 2px; }
.db-change { display: inline-flex; align-items: center; gap: var(--space-6); font-size: var(--fs-label); font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink2); }
.db-change::before { content: ""; border-inline: 4.5px solid transparent; border-bottom: 7px solid currentColor; }
.db-change[data-dir="up"] { color: var(--ok-text); }
.db-change[data-dir="down"] { color: var(--bad-text); }
.db-change[data-dir="down"]::before { transform: rotate(180deg); }
.db-heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(5, 12px); gap: 3px; }
.db-heat i { width: 12px; border-radius: 3px; background: var(--g-press); }
.db-heat i[data-v="1"] { background: var(--data-1); } .db-heat i[data-v="2"] { background: var(--data-2); } .db-heat i[data-v="3"] { background: var(--data-3); } .db-heat i[data-v="4"] { background: var(--data-4); } .db-heat i[data-v="5"] { background: var(--data-5); }

/* Block: a raised area. A block never sits inside a block. */
.db-block { --ground: var(--g1); background: var(--ground); border-radius: var(--radius-12); padding: var(--space-20); display: flex; flex-direction: column; gap: var(--space-16); min-width: 0; }
.db-block-head { display: flex; align-items: baseline; gap: var(--space-12); }
.db-block-head > :last-child:not(:first-child) { margin-left: auto; }

/* The pointer's light on a raised area: very soft, with a long falloff, drawn on
   the piece's own ground. In Ink it is a light; in Paper, where a light would not
   show, it is a soft cool shade. It follows a mouse or trackpad pointer on any
   device; a finger and reduced motion get the plain ground. */
.db-carry { position: relative; isolation: isolate; }
.db[data-pointer] { --lit: 1; }
@media (prefers-reduced-motion: reduce) { .db[data-pointer] { --lit: 0; } }
.db :is(.db-block, .db-rail, .db-lit, .db-carry, .db-tile, .db-split, .db-bay, .db-ask) {
  --shine: radial-gradient(circle var(--light-reach) at var(--px) var(--py), color-mix(in srgb, var(--pointer-light) calc(var(--lit) * 100%), transparent), color-mix(in srgb, var(--pointer-light) calc(var(--lit) * 50%), transparent) 28%, color-mix(in srgb, var(--pointer-light) calc(var(--lit) * 18%), transparent) 58%, transparent);
  background-image: var(--shine); }

/* List rows: one thing a line; the whole row opens it */
.db-rows { display: flex; flex-direction: column; }
.db-row { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 0.8fr) minmax(0, 1.1fr) 200px; align-items: center; gap: var(--space-16); min-height: var(--row); padding: var(--space-8) var(--space-12); margin-inline: calc(var(--space-12) * -1); border-radius: var(--radius-8); position: relative; cursor: pointer; transition: background var(--dur-140) var(--ease); }
.db-row + .db-row::before { content: ""; position: absolute; inset: 0 var(--space-12) auto; height: 1px; background: var(--hair); }
.db-row:hover { background: var(--g-hover); }
.db-row:hover::before, .db-row:hover + .db-row::before, .db-row:is([aria-selected="true"], .is-selected)::before, .db-row:is([aria-selected="true"], .is-selected) + .db-row::before { opacity: 0; }
.db-row:is([aria-selected="true"], .is-selected) { background: var(--live-wash); }
.db-row-name { font-weight: 500; overflow-wrap: anywhere; }
.db-row-sub { color: var(--ink3); font-size: var(--fs-label); }
/* Row controls (.db-row-acts, in a row of a list or of a table): out of sight until the pointer is on the row or
   the keys reach one of them, and always in sight where there is no pointer */
.db-row-acts { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-4); }
.db[data-mouse] .db-row-acts > * { opacity: 0; transition: opacity var(--dur-140) var(--ease); }
.db[data-mouse] :is(.db-row, tr):is(:hover, :focus-within) .db-row-acts > *, .db[data-mouse] .db-row-acts > :is(:focus-visible, [data-busy], [data-done], [aria-expanded="true"]) { opacity: 1; }
.db-row-end { display: flex; align-items: center; gap: var(--space-8); justify-content: flex-end; }
.db-row-end .db-btn { order: -1; }
.db-rows[data-rise] .db-row { animation: db-rise var(--dur-420) var(--ease) backwards; animation-delay: calc(var(--i, 0) * 35ms); }
/* Blocks, tiles, clusters and splits rise in the same way where the piece that holds them is marked data-rise,
   one after another in their order (or in the order --i gives) */
[data-rise] > :is(.db-block, .db-tile, .db-carry, .db-split) { animation: db-rise var(--dur-420) var(--ease) backwards; animation-delay: calc(var(--i, 0) * 35ms); }
[data-rise] > :nth-child(2) { --i: 1; } [data-rise] > :nth-child(3) { --i: 2; } [data-rise] > :nth-child(4) { --i: 3; } [data-rise] > :nth-child(5) { --i: 4; } [data-rise] > :nth-child(6) { --i: 5; }
[data-rise] > :nth-child(7) { --i: 6; } [data-rise] > :nth-child(8) { --i: 7; } [data-rise] > :nth-child(n+9) { --i: 8; }
@keyframes db-rise { from { opacity: 0; transform: translateY(10px); } }

/* What changed: a flash on the one part a click changed */
.db-flash { animation: db-flash var(--dur-1100) var(--ease); }
@keyframes db-flash { from { background-color: var(--live-wash); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--live) 50%, transparent); } }

/* Step track: where a thing stands on its way. A dot grows as the pointer nears it. */
.db-track { display: flex; }
.db-step { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: var(--space-8); position: relative; padding-right: var(--space-12); font-size: var(--fs-label); color: var(--ink3); }
.db-step::before { content: ""; width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--ink4); background: var(--ground, var(--g0)); position: relative; z-index: 1; transform: scale(calc(1 + var(--near, 0) * 0.5)); transition: transform var(--dur-240) var(--ease); }
.db-step::after { content: ""; position: absolute; top: 5px; left: 12px; right: 0; height: 2px; background: var(--ink4); border-radius: 2px; }
.db-step:last-child { flex: none; padding-right: 0; }
.db-step:last-child::after { display: none; }
.db-step[data-is="done"] { color: var(--ink2); }
.db-step[data-is="done"]::before { background: var(--ok); box-shadow: none; }
.db-step[data-is="done"]::after { background: var(--ok); }
.db-step[data-is="now"] { color: var(--ink); font-weight: 500; }
.db-step[data-is="now"]::before { background: var(--live); box-shadow: 0 0 0 4px var(--live-wash); }
/* The way's compact face: dots joined by short lines, with only the current step named, beside its dot. Any other
   step shows its name under its dot while the pointer is on it or the keys' mark is; a screen reader is told every name. */
.db-track:is([data-face="dots"], [data-tight]) { align-items: center; outline: none; }
.db-track:is([data-face="dots"], [data-tight]) .db-step { --line: var(--ink4); flex: none; flex-direction: row; align-items: center; gap: var(--space-8); padding: var(--space-8) var(--space-16) var(--space-8) 0; font-size: 0; white-space: nowrap; background: linear-gradient(var(--line), var(--line)) right center / var(--space-16) 2px no-repeat; }
.db-track:is([data-face="dots"], [data-tight]) .db-step[data-is="done"] { --line: var(--ok); }
.db-track:is([data-face="dots"], [data-tight]) .db-step[data-is="now"] { padding-right: var(--space-24); font-size: var(--fs-label); }
.db-track:is([data-face="dots"], [data-tight]) .db-step:last-child { padding-right: 0; background: none; }
.db-track:is([data-face="dots"], [data-tight]) .db-step::after { content: attr(data-name); display: block; top: calc(100% - 2px); left: 6px; right: auto; z-index: 2; width: auto; height: auto; padding: var(--space-4) var(--space-8); border-radius: var(--radius-6); background: var(--solid); color: var(--onsolid); font-size: var(--fs-label); font-weight: 400; opacity: 0; transform: translate(-50%, -4px); pointer-events: none; transition: opacity var(--dur-140) var(--ease), transform var(--dur-140) var(--ease); }
.db-track:is([data-face="dots"], [data-tight]) .db-step:first-child::after { transform: translate(-12px, -4px); }
.db-track:is([data-face="dots"], [data-tight]) .db-step:last-child::after { left: auto; right: -6px; transform: translate(0, -4px); }
.db-track:is([data-face="dots"], [data-tight]) .db-step:is(:hover, [data-at])::after { opacity: 1; transform: translate(-50%, 0); }
.db-track:is([data-face="dots"], [data-tight]) .db-step:first-child:is(:hover, [data-at])::after { transform: translate(-12px, 0); }
.db-track:is([data-face="dots"], [data-tight]) .db-step:last-child:is(:hover, [data-at])::after { transform: none; }
.db-track:is([data-face="dots"], [data-tight]) .db-step[data-is="now"]::after { display: none; }
.db-track:focus-visible .db-step[data-at]::before { box-shadow: var(--focus); }

/* Timeline: what happened, newest first */
.db-timeline { display: flex; flex-direction: column; }
.db-event { display: grid; grid-template-columns: 76px 12px minmax(0, 1fr); gap: var(--space-12); padding-bottom: var(--space-16); position: relative; }
.db-event-when { font-variant-numeric: tabular-nums; font-size: var(--fs-label); color: var(--ink3); text-align: right; padding-top: 2px; }
.db-event-dot { width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: var(--k, var(--ink4)); position: relative; z-index: 1; }
/* A dot may stand in a state's colour (data-is) in place of a kind's */
.db-event-dot[data-is="live"] { background: var(--live); }
.db-event-dot[data-is="wait"] { background: var(--wait); }
.db-event-dot[data-is="bad"] { background: var(--bad); }
.db-event-dot[data-is="ok"] { background: var(--ok); }
.db-event::before { content: ""; position: absolute; left: calc(76px + var(--space-12) + 4px); top: 16px; bottom: -6px; width: 2px; background: var(--hair); }
.db-event:last-child::before { display: none; }
.db-event-what b { font-weight: 500; }

/* Lanes: a week by kind of date */
.db-lanes { --lane: 48px; display: grid; grid-template-columns: 96px repeat(7, minmax(0, 1fr)); row-gap: var(--space-6); column-gap: 2px; align-items: center; }
.db-lanes-day { font-size: var(--fs-label); color: var(--ink3); text-align: center; padding-bottom: var(--space-4); }
.db-lanes-day[data-today] { color: var(--ink); font-weight: 600; }
.db-lane-name { font-size: var(--fs-label); color: var(--ink2); }
.db-lane-cell { height: var(--lane); background: var(--g-hover); border-radius: 4px; }
.db-lane-bar { grid-row: var(--r); grid-column: var(--c); height: var(--lane); border-radius: var(--radius-6); background: color-mix(in srgb, var(--k) 22%, var(--g1)); color: var(--ink); font-size: var(--fs-label); font-weight: 500; display: flex; align-items: center; padding-inline: var(--space-8); gap: var(--space-6); white-space: nowrap; overflow: hidden; z-index: 1; cursor: pointer; transition: background var(--dur-140) var(--ease), transform var(--dur-140) var(--ease); }
.db-lane-bar::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--k); flex: none; }
.db-lane-bar:hover { background: color-mix(in srgb, var(--k) 34%, var(--g1)); transform: translateY(-1px); }

/* Floating surfaces: menu, notice, sheet, tray and the controls beside a tray.
   Each carries a lit edge: its rim brightens where the pointer is near and
   falls off along the edge. With no pointer near, it has no edge at all. */
.db-menu, .db-notice, .db-selbar, .db-sheet, .db-tray, .db-outboard, .db-jump, .db-float, .db-rim, .db .db-carry[data-form="dock"]:not([data-ground]) { border: 1px solid transparent;
  background: linear-gradient(var(--ground), var(--ground)) padding-box,
    radial-gradient(circle calc(var(--light-reach) * 0.4) at var(--px) var(--py), color-mix(in srgb, var(--edge-near) calc(var(--lit) * 100%), transparent), color-mix(in srgb, var(--edge-near) calc(var(--lit) * 45%), transparent) 30%, color-mix(in srgb, var(--edge-near) calc(var(--lit) * 14%), transparent) 62%, transparent) border-box,
    var(--ground); }

.db-menu { --ground: var(--g3); position: fixed; inset: auto; z-index: 30; margin: 0; min-width: max(200px, var(--anchor-w, 0px)); max-width: calc(100vw - var(--space-16)); max-height: var(--room, none); overflow: auto; overscroll-behavior: contain; padding: var(--space-6); border-radius: var(--radius-12); color: var(--ink); box-shadow: var(--depth-2); transform-origin: top left; animation: db-pop var(--dur-240) var(--ease-settle); }
.db-menu[data-side="top"] { transform-origin: bottom left; }
.db-menu[data-leaving] { animation: db-fade var(--dur-140) var(--ease) reverse forwards; pointer-events: none; }
.db-menu > button { width: 100%; height: var(--h-32); padding-inline: var(--space-10); border: 0; border-radius: var(--radius-6); background: none; color: var(--ink); font: inherit; text-align: left; white-space: nowrap; cursor: pointer; display: flex; align-items: center; gap: var(--space-12); }
.db .db-menu > button:focus { background: var(--g-hover); box-shadow: none; }
.db-menu > hr { border: 0; height: 1px; background: var(--hair); margin: var(--space-6) 0; }
@keyframes db-pop { from { opacity: 0; transform: scale(0.96) translateY(-4px); } }

.db-notice { --ground: var(--g3); position: fixed; z-index: 60; left: 50%; bottom: max(var(--space-24), env(safe-area-inset-bottom, 0px)); translate: -50% 0; display: flex; align-items: center; gap: var(--space-12); padding: var(--space-10) var(--space-10) var(--space-10) var(--space-12); border-radius: var(--radius-12); box-shadow: var(--depth-2); animation: db-up var(--dur-420) var(--ease-settle); }
.db-notice[data-leaving] { animation: db-down var(--dur-240) var(--ease) forwards; }
.db-notice > span { margin-right: var(--space-4); }
/* The notice's time left: a small ring of the light that runs down in five seconds */
.db-notice-time { flex: none; width: 18px; height: 18px; border-radius: 50%; background: conic-gradient(var(--live) var(--left), var(--g-press) 0); mask: radial-gradient(closest-side, transparent 62%, #000 66%); animation: db-drain 5s linear forwards; }
.db-notice:hover .db-notice-time { animation-play-state: paused; }
@keyframes db-up { from { opacity: 0; transform: translateY(16px); } }
@keyframes db-down { to { opacity: 0; transform: translateY(12px); } }
@keyframes db-drain { to { --left: 0%; } }

.db-veil { position: fixed; inset: 0; z-index: 40; background: var(--veil); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: db-fade var(--dur-240) var(--ease); }
/* A veil on its way out takes no press: what is pressed is the page it is uncovering. */
.db-veil[data-leaving] { animation: db-fade var(--dur-240) var(--ease) reverse forwards; pointer-events: none; }
@keyframes db-fade { from { opacity: 0; } }
.db-sheet { --ground: var(--g2); position: fixed; z-index: 50; top: 50%; left: 50%; translate: -50% -50%; width: min(560px, calc(100vw - 32px)); max-height: calc(100% - 48px); overflow: auto; overscroll-behavior: contain; padding: var(--space-24); border-radius: var(--radius-16); box-shadow: var(--depth-3); display: flex; flex-direction: column; gap: var(--space-16); animation: db-sheet-in var(--dur-420) var(--ease-settle); }
.db-sheet[data-leaving] { animation: db-down var(--dur-240) var(--ease) forwards; pointer-events: none; }
@keyframes db-sheet-in { from { opacity: 0; transform: translateY(24px) scale(0.98); } }
.db-sheet-foot { display: flex; justify-content: flex-end; gap: var(--space-8); margin-top: var(--space-8); }

/* Tray: a side panel that holds everything about one thing. Its head is the thing itself
   (the carried cluster in its tray form) and stays put; under it a stack of bays scrolls.
   A bay is one cluster of one type on its own ground step, with clear space around it:
   ground, space and depth part the bays, never a line. A bay folds to one line that still
   says its key fact, and unfolds in place.
   Beside the tray's outer edge, over the veil, float its controls, a jump control with one
   mark for each bay, and at most a few small pieces that belong to what the tray shows.
   Pinned, the tray lets the screen behind be used: the veil goes, the controls and the jump
   control fold into the tray's top edge, and the small pieces leave. */
.db-tray { --ground: var(--g1); position: fixed; z-index: 50; top: 0; right: 0; bottom: 0; width: min(var(--tray-w), 100vw); box-shadow: var(--depth-3); display: flex; flex-direction: column; animation: db-tray-in var(--dur-240) var(--ease); }
.db-tray[data-leaving] { animation: db-tray-out var(--dur-240) var(--ease) forwards; pointer-events: none; }
@keyframes db-tray-in { from { transform: translateX(100%); } }
@keyframes db-tray-out { to { transform: translateX(100%); } }
.db-tray-top { position: relative; z-index: 1; flex: none; padding: var(--space-20) var(--space-20) var(--space-16); }
.db-tray-top::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: var(--space-16); background: linear-gradient(var(--ground), transparent); opacity: 0; transition: opacity var(--dur-140) var(--ease); pointer-events: none; }
.db-tray[data-scrolled] .db-tray-top::after { opacity: 1; }
.db-tray-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 0 var(--space-12) var(--space-24); padding-right: max(var(--space-12), env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: var(--space-12); }
.db-carry[data-form="tray"] { --mark: 40px; --carry-gap: var(--space-16) var(--space-12); --carry-pad: 0px; border-radius: 0; background: none; align-items: flex-start; }
.db-carry[data-form="tray"] .db-carry-id { flex: 1 1 0; gap: var(--space-4); }
.db-carry[data-form="tray"] .db-carry-name { font-size: var(--fs-title-s); line-height: 1.2; }
.db-carry[data-form="tray"] .db-carry-figs { flex: 1 1 100%; gap: var(--space-12) var(--space-24); }
.db-carry[data-form="tray"] .db-carry-fig { white-space: normal; }
.db-carry[data-form="tray"]:not([data-way]) .db-carry-way, .db-carry[data-form="tray"] .db-carry-acts { display: none; }

/* Bay: its head says what it holds, shows its key fact while it is folded, and folds or unfolds it */
.db-bay { --ground: var(--g2); flex: none; min-width: 0; border-radius: var(--radius-12); background: var(--ground); display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; transition: grid-template-rows var(--dur-240) var(--ease); scroll-margin-top: var(--space-4); }
.db-bay[data-folded] { grid-template-rows: auto 0fr; }
.db-bay-head { min-width: 0; min-height: var(--row); padding: 0 var(--space-16); border: 0; border-radius: inherit; background: none; color: var(--ink2); font: inherit; font-size: var(--fs-label); font-weight: 500; text-align: left; cursor: pointer; display: flex; align-items: center; gap: var(--space-10); transition: color var(--dur-140) var(--ease); }
.db-bay-head:hover { color: var(--ink); }
.db-bay-mark { color: var(--ink3); }
.db-bay-key { margin-left: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-size: var(--fs-body); font-weight: 400; font-variant-numeric: tabular-nums; opacity: 0; transform: translateY(4px); transition: opacity var(--dur-240) var(--ease), transform var(--dur-240) var(--ease); }
.db-bay[data-folded] .db-bay-key { opacity: 1; transform: none; }
.db-bay-head::after { content: ""; flex: none; width: 7px; height: 7px; margin: 0 2px 3px var(--space-4); border-right: 1.5px solid var(--ink3); border-bottom: 1.5px solid var(--ink3); transform: rotate(45deg); transition: transform var(--dur-240) var(--ease-settle); }
.db-bay[data-folded] .db-bay-head::after { transform: translate(-2px, 2px) rotate(-45deg); }
.db-bay-fold { min-height: 0; overflow: hidden; }
.db-bay[data-folded] .db-bay-fold { visibility: hidden; transition: visibility 0s linear var(--dur-240); }
.db-bay-body { padding: var(--space-4) var(--space-16) var(--space-16); display: flex; flex-direction: column; gap: var(--space-16); }
/* What needs the person: first in the tray, on a state ground, one sentence and the one button to click that answers it */
.db-ask { --ground: var(--g2); flex: none; padding: var(--space-16); border-radius: var(--radius-12); background: var(--ground); display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-12); font-weight: 500; scroll-margin-top: var(--space-4); }
/* A fact: its label above its value, each at full width */
.db-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-12) var(--space-16); }
.db-fact { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.db-fact[data-wide] { grid-column: 1 / -1; }
/* A part that folds away under the press that names it */
.db-fold { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 1fr; transition: grid-template-rows var(--dur-240) var(--ease); }
.db-fold[data-folded] { grid-template-rows: 0fr; }
.db-fold > * { min-height: 0; overflow: hidden; }
/* Under its press a folded part takes no room; unfolded it stands a step below the press */
.db-more + .db-fold { margin-top: calc(var(--space-16) * -1); }
.db-more + .db-fold > * > :first-child { margin-top: var(--space-12); }
.db-fold[data-folded] > * { visibility: hidden; transition: visibility 0s linear var(--dur-240); }
.db-more { align-self: flex-start; min-height: var(--h-28); padding: 0; border: 0; background: none; color: var(--ink2); font: inherit; font-size: var(--fs-label); cursor: pointer; display: inline-flex; align-items: center; gap: var(--space-8); transition: color var(--dur-140) var(--ease); }
.db-more:hover { color: var(--ink); }
.db-more::after { content: ""; width: 6px; height: 6px; margin-bottom: 3px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform var(--dur-240) var(--ease-settle); }
.db-more[aria-expanded="true"]::after { transform: translateY(3px) rotate(-135deg); }

/* Money: the total as the figure, and one lit bar of its parts (paid, owed, late). A part and
   its line in the list under the bar answer the pointer together. */
.db-parts { display: flex; flex-direction: column; gap: var(--space-4); }
.db-parts-bar { height: 14px; margin-bottom: var(--space-6); display: flex; align-items: center; gap: 3px; }
.db-parts-part { flex: var(--v, 1) 1 0; min-width: 8px; height: 10px; border-radius: var(--radius-pill); background: var(--c, var(--ink4)); transition: height var(--dur-240) var(--ease-settle), opacity var(--dur-140) var(--ease), box-shadow var(--dur-240) var(--ease); }
.db-parts [data-is="ok"] { --c: var(--ok); }
.db-parts [data-is="wait"] { --c: var(--wait); }
.db-parts [data-is="bad"] { --c: var(--bad); }
.db-parts [data-is="live"] { --c: var(--live); }
.db-parts-part[data-is] { background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 72%, var(--light-core))); box-shadow: 0 0 16px -3px color-mix(in srgb, var(--c) var(--glow), transparent); }
.db-parts-key { min-height: var(--h-24); display: flex; align-items: baseline; gap: var(--space-8); color: var(--ink2); font-size: var(--fs-label); transition: color var(--dur-140) var(--ease), opacity var(--dur-140) var(--ease); }
.db-parts-key::before { content: ""; flex: none; align-self: center; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--ink4)); }
.db-parts-key > :last-child { margin-left: auto; color: var(--ink); font-size: var(--fs-body); font-variant-numeric: tabular-nums; }
.db-parts[data-at] .db-parts-part:not([data-on]), .db-parts[data-at] .db-parts-key:not([data-on]) { opacity: 0.4; }
.db-parts-part[data-on] { height: 14px; }
.db-parts-key[data-on] { color: var(--ink); }

/* People: who it is and their part in it, the ways to reach them as presses, and a second person folded under the first */
.db-contact { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 0 var(--space-12); }
.db-contact > .db-who-mark { --mark: 40px; grid-row: 1 / span 2; }
.db-contact-name { align-self: end; font-weight: 500; overflow-wrap: anywhere; }
.db-contact-part { align-self: start; color: var(--ink3); font-size: var(--fs-label); }
.db-reach { grid-column: 1 / -1; margin-top: var(--space-12); display: flex; flex-wrap: wrap; gap: var(--space-6); }

/* Place: a small drawn mark of the place beside its address; how to get in and the hours under them */
.db-place { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: center; gap: var(--space-16); }
.db-place-mark { --k: var(--hue-3); width: 72px; height: 72px; border-radius: var(--radius-12); background: color-mix(in srgb, var(--k) 12%, var(--g1)); color: var(--k); fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.db-place-where { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.db-place-where b { font-weight: 500; }

/* Notes: a note in its paragraphs with who wrote it and when, and a field to write one in. The field is several
   lines tall from the first and grows with what is written; a note is never written in a one-line field. */
.db-note { margin: 0; display: flex; flex-direction: column; gap: var(--space-4); }
.db-note > p { margin: 0; line-height: 1.5; overflow-wrap: anywhere; }
.db-note > p + p { margin-top: var(--space-4); }
.db-note-add { display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-8); }
.db-note-add > textarea { align-self: stretch; width: auto; min-width: 0; min-height: 104px; max-height: 320px; field-sizing: content; }
/* In a bay a picture strip is smaller */
.db-bay .db-strip-item, .db-bay .db-strip-item .db-thumb { width: 104px; }
.db-bay .db-strip-item .db-thumb { height: 76px; }

/* Beside the tray: the outboard controls, the jump control and the small floating pieces.
   They arrive and leave with the tray. */
.db-tray-side { position: absolute; top: var(--space-24); right: 100%; margin-right: var(--space-12); display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-12); }
.db-outboard, .db-jump { --ground: var(--g3); flex: none; display: flex; flex-direction: column; gap: 2px; padding: 3px; border-radius: var(--radius-pill); box-shadow: var(--depth-2); animation: db-outboard-in var(--dur-420) var(--ease-settle) 120ms backwards; }
.db-jump { animation-delay: 180ms; }
.db-outboard > hr { width: var(--space-16); height: 1px; margin: var(--space-4) auto; border: 0; background: var(--hair); }
.db-jump > button { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--ink3); cursor: pointer; display: grid; place-items: center; transition: background var(--dur-140) var(--ease), color var(--dur-140) var(--ease); }
.db-jump > button:hover { background: var(--g-hover); color: var(--ink); }
.db-jump > button[aria-current="true"] { background: var(--live-wash); color: var(--live-text); }
.db-jump > button > i { width: 8px; height: 8px; border-radius: 50%; background: var(--c, currentColor); }
.db-jump [data-is="wait"] { --c: var(--wait); } .db-jump [data-is="bad"] { --c: var(--bad); } .db-jump [data-is="ok"] { --c: var(--ok); } .db-jump [data-is="live"] { --c: var(--live); }
.db-floats { position: absolute; right: 100%; bottom: var(--space-24); width: max-content; margin-right: var(--space-12); display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-8); animation: db-outboard-in var(--dur-420) var(--ease-settle) 240ms backwards; transition: opacity var(--dur-240) var(--ease), transform var(--dur-240) var(--ease), visibility 0s; }
.db-float { --ground: var(--g3); max-width: 216px; padding: var(--space-10) var(--space-16); border-radius: var(--radius-12); box-shadow: var(--depth-2); display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.db-float-fig { font-size: var(--fs-lead); font-weight: 500; font-variant-numeric: tabular-nums; }
.db-tray[data-leaving] :is(.db-outboard, .db-jump, .db-floats) { animation: db-fade var(--dur-90) var(--ease) reverse forwards; }
@keyframes db-outboard-in { from { opacity: 0; transform: translateX(var(--space-16)); } }
/* Pinned, they stand in a row along the tray's top edge. A copy that is leaving carries the form it stood in. */
.db-tray[data-pinned] .db-tray-side, .db-tray-side[data-pinned] { position: static; flex: none; margin: 0; padding: var(--space-8) var(--space-12) 0; flex-direction: row; align-items: center; gap: var(--space-4); }
:is(.db-tray, .db-tray-side)[data-pinned] :is(.db-outboard, .db-jump) { flex-direction: row; padding: 0; border-color: transparent; background: none; box-shadow: none; }
:is(.db-tray, .db-tray-side)[data-pinned] .db-outboard { order: 1; margin-left: auto; }
/* The row never runs past the tray: the jump marks close up first, so a tray with many bays still fits its controls */
:is(.db-tray, .db-tray-side)[data-pinned] .db-jump { flex: 0 1 auto; min-width: 0; gap: 0; }
:is(.db-tray, .db-tray-side)[data-pinned] .db-jump > button { flex: 0 1 30px; min-width: 0; }
:is(.db-tray, .db-tray-side)[data-pinned] .db-outboard { gap: 0; }
:is(.db-tray, .db-tray-side)[data-pinned] .db-outboard > hr { width: 1px; height: var(--space-16); margin: auto var(--space-4); }
.db-tray-side[inert] :is(.db-outboard, .db-jump) { animation: none; }
.db-tray[data-pinned] .db-tray-top { padding-top: var(--space-12); }
.db-tray[data-pinned] .db-floats { opacity: 0; transform: translateX(var(--space-16)); visibility: hidden; pointer-events: none; transition: opacity var(--dur-240) var(--ease), transform var(--dur-240) var(--ease), visibility 0s linear var(--dur-240); }
@media (max-width: 480px) {
  .db-tray-side { position: static; margin: 0; padding: var(--space-8) var(--space-12) 0; flex-direction: row; align-items: center; }
  :is(.db-outboard, .db-jump) { flex-direction: row; padding: 0; border-color: transparent; background: none; box-shadow: none; }
  .db-outboard { order: 1; margin-left: auto; }
  .db-outboard > hr { width: 1px; height: var(--space-16); margin: auto var(--space-4); }
  .db-floats { display: none; }
}

/* Date tile: a small piece, the day's number over its month. With a state (data-is) it is lit from below in that
   state's colour. What the day holds is written beside the tile, never in it. */
.db-datetile { flex: none; width: 48px; height: 48px; border-radius: var(--radius-12); display: flex; flex-direction: column; align-items: center; justify-content: center;
  /* Lit from below: a long eased falloff, and a brighter bed along the bottom edge */
  background: radial-gradient(140% 46% at 50% 112%, color-mix(in srgb, var(--c, transparent) calc(var(--glow) * 1.5), transparent), color-mix(in srgb, var(--c, transparent) calc(var(--glow) * 0.6), transparent) 45%, transparent 100%),
    linear-gradient(to top, color-mix(in srgb, var(--c, transparent) calc(var(--glow) * 1.00), transparent) 0%, color-mix(in srgb, var(--c, transparent) calc(var(--glow) * 0.76), transparent) 7%, color-mix(in srgb, var(--c, transparent) calc(var(--glow) * 0.56), transparent) 15%, color-mix(in srgb, var(--c, transparent) calc(var(--glow) * 0.40), transparent) 24%, color-mix(in srgb, var(--c, transparent) calc(var(--glow) * 0.27), transparent) 34%, color-mix(in srgb, var(--c, transparent) calc(var(--glow) * 0.17), transparent) 45%, color-mix(in srgb, var(--c, transparent) calc(var(--glow) * 0.10), transparent) 57%, color-mix(in srgb, var(--c, transparent) calc(var(--glow) * 0.05), transparent) 69%, color-mix(in srgb, var(--c, transparent) calc(var(--glow) * 0.02), transparent) 81%, transparent 92%), var(--g2); }
.db-datetile-day { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-lead); line-height: 1.15; font-variant-numeric: tabular-nums; }
.db-datetile-sub { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-label); line-height: 1.15; color: var(--ink2); }
/* The same tile at the height of a row of a table or a list */
.db-datetile--row, .db-dated--row > .db-datetile { width: 40px; height: 40px; border-radius: var(--radius-8); }
:is(.db-datetile--row, .db-dated--row > .db-datetile) .db-datetile-day { font-size: var(--fs-body); }
/* A date tile with words: the tile, and beside it a name line over a quieter line (.db-row-name, .db-row-sub),
   centred on the tile and 12 px from it. The words wrap; the tile keeps its size. .db-dated--row holds the row's tile. */
.db-dated { display: flex; align-items: center; gap: var(--space-12); min-width: 0; }
.db-dated > :not(.db-datetile) { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }

/* Agenda: dated things, one a line, each with a short bar in the colour of its kind
   standing beside its words */
.db-agenda { display: flex; flex-direction: column; gap: var(--space-12); min-width: 0; }
.db-agenda-item { display: grid; grid-template-columns: 4px minmax(0, 1fr); column-gap: var(--space-12); }
.db-agenda-item::before { content: ""; grid-row: 1 / span 2; margin-block: 3px; border-radius: var(--radius-pill); background: var(--k, var(--ink4)); }
.db-agenda-item b { font-weight: 500; }

/* Week strip: seven days, the chosen one raised; the raise slides to the day pressed */
.db-week { position: relative; isolation: isolate; display: grid; grid-template-columns: repeat(7, minmax(0, 56px)); gap: 2px; width: fit-content; max-width: 100%; }
.db-week::before { content: ""; position: absolute; z-index: -1; top: 0; bottom: 0; left: 0; width: var(--w, 0); transform: translateX(var(--x, 0)); border-radius: var(--radius-12); background: var(--g3); box-shadow: var(--depth-2); transition: transform var(--dur-240) var(--ease-settle); }
.db-week button { position: relative; height: 64px; padding: 0; border: 0; border-radius: var(--radius-12); background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; font: inherit; font-size: var(--fs-label); color: var(--ink3); cursor: pointer; transition: color var(--dur-140) var(--ease); }
.db-week button b { font-size: var(--fs-body); font-weight: 500; font-variant-numeric: tabular-nums; color: var(--ink2); transition: color var(--dur-140) var(--ease); }
.db-week button:hover, .db-week button:hover b, .db-week button[aria-pressed="true"], .db-week button[aria-pressed="true"] b { color: var(--ink); }
.db-week button[aria-pressed="true"] b { font-weight: 600; }
/* Under a day, what it holds: for each kind a dot in its colour and how many of that kind. A kind the day does not
   hold keeps its line, empty, so each kind runs along one line of the week. */
.db-week:has(.db-week-kinds) { grid-template-columns: repeat(7, minmax(0, 88px)); }
.db-week button:has(.db-week-kinds) { height: auto; min-height: 64px; padding: var(--space-8) 0 var(--space-12); justify-content: flex-start; }
.db-week-kinds { margin-top: var(--space-6); display: flex; flex-direction: column; align-items: center; gap: var(--space-4); }
.db-week-kinds > * { display: inline-flex; align-items: center; gap: var(--space-4); font-size: var(--fs-label); font-weight: 400; line-height: 1; font-variant-numeric: tabular-nums; color: var(--ink2); }
.db-week-kinds > *::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: var(--k, var(--ink3)); }
.db-week-kinds > :empty { visibility: hidden; }
.db-week-kinds > :empty::after { content: "0"; }
.db-week button[aria-pressed="true"] .db-week-kinds > * { color: var(--ink); }
.db-week button[aria-current="date"]::after { content: ""; position: absolute; left: 50%; bottom: 5px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; }

/* Day dots: one a day; a day that is done fills and takes a check */
.db-days { display: inline-grid; grid-auto-flow: column; gap: var(--space-10); }
.db-day { position: relative; padding: 0; border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: var(--space-6); font: inherit; font-size: var(--fs-label); color: var(--ink3); cursor: pointer; }
.db-day::before { content: ""; width: 30px; height: 30px; border-radius: 50%; background: var(--g-press); transition: background var(--dur-240) var(--ease), box-shadow var(--dur-240) var(--ease); }
.db-day::after { content: ""; position: absolute; top: 10px; left: 50%; width: 11px; height: 6px; margin-left: -5.5px; border-left: 2px solid var(--on-signal); border-bottom: 2px solid var(--on-signal); transform: rotate(-45deg) scale(0); transition: transform var(--dur-240) var(--ease-settle); }
.db-day[aria-current="date"]::before { box-shadow: inset 0 0 0 2px var(--ink4); }
.db-day[data-is="done"] { color: var(--ink2); }
.db-day[data-is="done"]::before { background: var(--c); box-shadow: 0 0 14px -3px color-mix(in srgb, var(--c) var(--glow), transparent); }
.db-day[data-is="done"]::after { transform: rotate(-45deg) scale(1); }
/* A day done in wait takes its check in the wait ground's ink */
.db-days[data-is="wait"] .db-day::after { border-color: var(--on-wait); }

/* Tile: one thing to do, clicked when it is done. Done, its round mark takes the state's ground and the tile stays on
   depth; a tile marked data-tick-ground takes the whole ground. */
.db-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-8); }
.db-tile { --ground: var(--g1); position: relative; min-height: 112px; padding: var(--space-16); border: 0; border-radius: var(--radius-12); background: var(--ground); color: var(--ink); font: inherit; text-align: left; cursor: pointer; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; transition: transform var(--dur-90) var(--ease); }
.db-tile:active { transform: scale(0.98); }
.db-tile b { font-weight: 500; }
/* A tile over a tick box: the box is out of sight and the tile is its target; a group whose tiles are all ticked is marked
   data-complete and takes no ground */
.db-tile > input[type="checkbox"] { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.db .db-tile:has(> input:focus-visible) { box-shadow: var(--focus); }
/* A tile that holds controls is not itself a target. Its tick is a small target of its own at the tile's foot
   (.db-tile-tick, a label over the tick box), and its body (.db-tile-body) holds a pick, a field or a tick box. */
div.db-tile { cursor: default; }
div.db-tile:active { transform: none; }
.db-tiles:has(.db-tile-body) { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.db-tile-body { align-self: stretch; margin-block: var(--space-12); display: flex; flex-direction: column; gap: var(--space-8); }
.db-tile-tick { align-self: flex-end; margin-top: auto; display: inline-flex; align-items: center; gap: var(--space-8); cursor: pointer; }
.db-tile-tick > input[type="checkbox"] { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.db-tile-tick > .db-tile-mark { align-self: auto; margin-top: 0; }
.db-tile-tick:hover > .db-tile-mark:not([data-ground]) { background: var(--ink4); }
.db .db-tile-tick:has(> input:focus-visible) > .db-tile-mark { box-shadow: var(--focus); }
.db-tile-mark { align-self: flex-end; margin-top: auto; width: 28px; height: 28px; border-radius: 50%; background: var(--g-press); display: grid; place-items: center; transition: background var(--dur-140) var(--ease); }
.db-tile:hover .db-tile-mark:not([data-ground]) { background: var(--ink4); }
/* A ticked tile stays on depth: its round mark takes the state's ground, with the check in the ground's ink (--on-fill
   on it), and the wash plays inside the mark. A tile marked data-tick-ground takes the whole ground instead, for the
   place where that one tile is the screen's large colour. */
.db-tile-mark[data-ground] { background-color: var(--ground); }
.db-tile-mark::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--ink3); }
/* A filter's mark, on a tile or a chip that filters or can be chosen: a dot at rest, a check while it is on (aria-pressed or aria-selected on the press that carries it, or a filter pick that holds a choice) */
.db-filter-mark { --m: 16px; flex: none; width: var(--m); height: var(--m); border-radius: 50%; background: var(--g-press); display: inline-grid; place-items: center; transition: background var(--dur-140) var(--ease); }
.db-filter-mark::before, .db-filter-mark::after { content: ""; grid-area: 1 / 1; transition: transform var(--dur-240) var(--ease-settle); }
.db-filter-mark::before { width: 26%; height: 26%; border-radius: 50%; background: var(--k, var(--ink3)); }
.db-filter-mark::after { width: 44%; height: 24%; border-left: max(1.5px, calc(var(--m) / 14)) solid var(--on-mark); border-bottom: max(1.5px, calc(var(--m) / 14)) solid var(--on-mark); transform: translateY(-14%) rotate(-45deg) scale(0); }
:is([aria-pressed="true"], [aria-selected="true"], .db-filter[data-on] > .db-pick-btn) > .db-filter-mark { background: var(--on-fill); }
:is([aria-pressed="true"], [aria-selected="true"], .db-filter[data-on] > .db-pick-btn) > .db-filter-mark::before { transform: scale(0); }
:is([aria-pressed="true"], [aria-selected="true"], .db-filter[data-on] > .db-pick-btn) > .db-filter-mark::after { transform: translateY(-14%) rotate(-45deg) scale(1); }
.db-tile > .db-filter-mark { --m: 28px; align-self: flex-end; margin-top: auto; }
.db-chip:has(> .db-filter-mark) { padding-left: var(--space-4); border: 0; font: inherit; font-size: var(--fs-label); cursor: pointer; }
.db-chip:has(> .db-filter-mark)::before { display: none; }
.db-tile[data-ground] .db-tile-mark::before, .db-tile-mark[data-ground]::before { width: 11px; height: 6px; border-radius: 0; background: none; border-left: 2px solid var(--on-fill); border-bottom: 2px solid var(--on-fill); transform: translateY(-1.5px) rotate(-45deg); }

/* Split panel: one block in two parts with no line between. The coloured part holds
   the main fact, in a state's colour (data-ground) or a kind's (data-kind); the
   plain part holds the rest and what can be done. */
.db-split { --ground: var(--g1); background: var(--ground); border-radius: var(--radius-12); overflow: hidden; min-width: 0; display: flex; flex-wrap: wrap; }
.db-split-main { flex: 2 1 150px; min-width: 0; padding: var(--space-20); background: var(--ground); display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-24); }
.db-split-main[data-kind] { --ground: var(--k); }
.db-split-rest { flex: 3 1 220px; min-width: 0; padding: var(--space-20); display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-4); }
.db-split-rest b { font-weight: 500; }
/* A foot band runs under both parts of a split. It stands on depth and says what it has to say with a status mark and words. */
.db-split-foot { flex: 1 1 100%; min-width: 0; min-height: var(--h-36); padding: var(--space-6) var(--space-20); background: var(--g2); color: var(--ink2); font-size: var(--fs-label); display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4) var(--space-16); }
.db-split-foot > :last-child:not(:first-child) { margin-left: auto; }
.db-split-acts { margin-top: auto; padding-top: var(--space-16); display: flex; flex-wrap: wrap; gap: var(--space-8); }

/* The carried cluster: the unit a business moves through its work (an order, a
   service visit), shown as one object on every screen. It is made of parts:
     mark   optional: a photograph of the thing itself. Never a monogram, initials or a drawn emblem standing
            for a customer or a job: the name is the thing. Every form closes up where it is left out.
     name   wraps, and is never cut
     state  a status mark
     figs   up to three key figures
     way    where it stands on its way: a step track, a ring, or a count
     acts   what can be done to it
   A form (data-form) is the layout a screen asks for: bar, pill, block, rail,
   tile, dock, headline, chip, tray. Each form says how far each part shrinks. A screen
   can ask for its own arrangement instead, with no new styles:
     data-flow="across|down"     which way the parts run
     data-figs="0|1|2|3"         how many figures show
     data-way="track|ring|count|none"
     data-steps="down"           the steps of its way run down, each named, whatever the form
     data-hide="mark state acts labels"   parts to leave out
     data-dock                   no ground of its own: it sits in another piece
     data-echo                   a copy left behind in a list; it does not travel
     data-fold="bar"             the compact form a hero folds to when the calendar, document or grid under it
                                 needs the screen. A click inside it on what names it (data-db-fold="#its-id"), or
                                 Kit.fold(it, true), folds it and opens it again; the page under it moves with it.
     --mark, --carry-gap, --carry-pad    sizes
   Moving to another screen, every part travels to its new place and size. */
.db-carry { --ground: var(--g1); --mark: 36px; --carry-gap: var(--space-12) var(--space-32); --carry-pad: var(--space-16) var(--space-20); background: var(--ground); color: var(--ink); min-width: 0; padding: var(--carry-pad); border-radius: var(--radius-12); display: flex; flex-wrap: wrap; align-items: center; gap: var(--carry-gap); }
.db-carry-mark { flex: none; width: var(--mark); height: var(--mark); border-radius: 28%; overflow: hidden; display: grid; place-items: center; background: color-mix(in srgb, var(--k, var(--ink3)) 24%, transparent); color: var(--ink); font-size: var(--fs-label); font-weight: 600; }
.db-carry-mark svg { width: 58%; height: 58%; }
.db-carry-mark img { width: 100%; height: 100%; object-fit: cover; }
.db-carry-id { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.db-carry-state { white-space: normal; }
.db-carry-name { min-width: 0; overflow-wrap: anywhere; font-family: var(--font-display); font-weight: 600; font-size: var(--fs-lead); line-height: 1.25; text-wrap: balance; }
.db-carry-figs { min-width: 0; display: flex; flex-wrap: wrap; gap: var(--space-12) var(--space-32); }
.db-carry-fig { display: flex; flex-direction: column; align-items: flex-start; white-space: nowrap; }
.db-carry-way { min-width: 0; display: flex; align-items: center; }
.db-carry-way > .db-track { flex: 1; }
.db-carry-way > .db-ring { width: 40px; height: 40px; font-size: var(--fs-label); }
.db-carry-way > .db-ring, .db-carry-way > .db-carry-count { display: none; }
.db-carry-count { font-size: var(--fs-label); font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink2); }
.db-carry-count b { font-weight: 600; color: var(--ink); }
.db-carry-acts { flex: none; display: flex; gap: var(--space-8); }
/* Where a cluster's move is made by hand: a stand-in for its ground while it
   travels, and the copy of the screen before that fades out over the new one */
.db-carry-ghost { position: absolute; z-index: -1; pointer-events: none; }
.db-carry-old { z-index: 4; margin: 0; pointer-events: none; }

/* How far the parts shrink: what a form leaves out unless the screen says otherwise */
.db-carry[data-form="chip"]:not([data-figs]) .db-carry-figs, .db-carry[data-figs="0"] .db-carry-figs { display: none; }
.db-carry:is([data-form="pill"], [data-form="tile"]):not([data-figs]) .db-carry-fig:nth-child(n+2), .db-carry[data-figs="1"] .db-carry-fig:nth-child(n+2) { display: none; }
.db-carry[data-form="dock"]:not([data-figs]) .db-carry-fig:nth-child(n+3), .db-carry[data-figs="2"] .db-carry-fig:nth-child(n+3) { display: none; }
.db-carry:is([data-form="tile"], [data-form="rail"], [data-form="dock"]):not([data-way]) .db-carry-way > :not(.db-ring), .db-carry[data-way="ring"] .db-carry-way > :not(.db-ring) { display: none; }
.db-carry:is([data-form="tile"], [data-form="rail"], [data-form="dock"]):not([data-way]) .db-carry-way > .db-ring, .db-carry[data-way="ring"] .db-carry-way > .db-ring { display: inline-grid; }
.db-carry[data-form="pill"]:not([data-way]) .db-carry-way > :not(.db-carry-count), .db-carry[data-way="count"] .db-carry-way > :not(.db-carry-count) { display: none; }
.db-carry[data-form="pill"]:not([data-way]) .db-carry-way > .db-carry-count, .db-carry[data-way="count"] .db-carry-way > .db-carry-count { display: inline; }
.db-carry[data-form="chip"]:not([data-way]) .db-carry-way, .db-carry[data-way="none"] .db-carry-way { display: none; }
.db-carry:is([data-form="pill"], [data-form="tile"], [data-form="rail"], [data-form="chip"]) .db-carry-acts, .db-carry[data-hide~="acts"] .db-carry-acts, .db-carry[data-hide~="mark"] .db-carry-mark, .db-carry[data-hide~="state"] .db-carry-state, .db-carry[data-hide~="labels"] .db-carry-fig .db-label { display: none; }
.db-carry[data-form="chip"] .db-carry-state { gap: 0; font-size: 0; }
.db-carry[data-flow="across"] { flex-direction: row; align-items: center; }
.db-carry[data-flow="down"] { flex-direction: column; flex-wrap: nowrap; align-items: flex-start; }
.db .db-carry[data-dock] { padding: 0; border-radius: 0; background: none; }

/* The forms */
/* Bar: one line. Its acts never leave it: a way too long to stand in full shows its compact face, and where the
   bar is still cramped its figures stand in a row of their own under the line. */
.db-carry[data-form="bar"] { flex-wrap: nowrap; }
.db-carry[data-form="bar"] .db-carry-id { flex: 0 1 auto; }
.db-carry[data-form="bar"] .db-carry-figs { flex: 0 1 auto; }
.db-carry[data-form="bar"] .db-carry-way { flex: 1 1 280px; max-width: 440px; margin-left: auto; }
.db-carry[data-form="bar"] .db-carry-way:has(> .db-track:is([data-face="dots"], [data-tight])) { flex: none; }
.db-carry[data-form="bar"]:has(> .db-carry-figs[data-under]) { flex-wrap: wrap; }
.db-carry[data-form="bar"]:has(> .db-carry-figs[data-under]) .db-carry-id { flex: 1 1 0; }
.db-carry[data-form="bar"] .db-carry-figs[data-under] { order: 1; flex: 1 1 100%; }
.db-carry[data-form="pill"] { --mark: 28px; --carry-gap: var(--space-4) var(--space-12); --carry-pad: var(--space-6) var(--space-16); display: inline-flex; min-height: 40px; border-radius: 20px; }
.db-carry[data-form="pill"]:has(> .db-carry-mark):not([data-hide~="mark"]) { --carry-pad: var(--space-6) var(--space-16) var(--space-6) var(--space-6); }
.db-carry[data-form="pill"] .db-carry-id { flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--space-4) var(--space-12); }
.db-carry[data-form="pill"] .db-carry-name { font-size: var(--fs-body); }
.db-carry[data-form="pill"] .db-carry-fig .db-label { display: none; }
.db-carry[data-form="block"] { --mark: 44px; --carry-gap: var(--space-20); --carry-pad: var(--space-20); flex-direction: column; flex-wrap: nowrap; align-items: stretch; }
.db-carry[data-form="block"] .db-carry-mark { align-self: flex-start; }
.db-carry[data-form="block"] .db-carry-name { font-size: var(--fs-title-s); }
.db-carry[data-form="block"] .db-carry-acts { margin-top: auto; }
.db-carry:is([data-form="block"], [data-flow="down"], [data-steps="down"]) .db-track { flex-direction: column; }
.db-carry:is([data-form="block"], [data-flow="down"], [data-steps="down"]) .db-step { flex: none; flex-direction: row; align-items: center; gap: var(--space-12); padding: 0 0 var(--space-16); }
.db-carry:is([data-form="block"], [data-flow="down"], [data-steps="down"]) .db-step:last-child { padding-bottom: 0; }
.db-carry:is([data-form="block"], [data-flow="down"], [data-steps="down"]) .db-step::after { top: 17px; bottom: -3px; left: 5px; right: auto; width: 2px; height: auto; }
/* A person, one piece with three faces. The mark alone (.db-who-mark): their picture, or their initials, which the
   kit writes from the name (data-name). The mark and words (.db-who): the mark, the name and one line under it. And
   a whole row that is one target (a.db-who): the same, with their number or address as a third line and the mark of
   what the press does; the row is a link that calls them or writes to them. */
.db-who-mark { --mark: 28px; --k: var(--hue-2); flex: none; width: var(--mark); height: var(--mark); border-radius: 50%; overflow: hidden; display: inline-grid; place-items: center; background: color-mix(in srgb, var(--k) 24%, transparent); color: var(--ink); font-size: var(--fs-label); font-weight: 600; line-height: 1; }
.db-who-mark img { width: 100%; height: 100%; object-fit: cover; }
.db-person > .db-who-mark { --mark: 22px; margin-left: calc(var(--space-6) * -1); margin-right: var(--space-4); }
.db-who { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0 var(--space-12); color: var(--ink); }
.db-who > .db-who-mark, .db-who > .db-mark { grid-row: 1 / span 3; }
.db-who > :not(.db-who-mark, .db-mark) { grid-column: 2; min-width: 0; overflow-wrap: anywhere; }
.db-who-name { font-weight: 500; }
.db-who-line { font-size: var(--fs-label); color: var(--ink3); }
.db-who-at { font-size: var(--fs-label); color: var(--ink2); font-variant-numeric: tabular-nums; }
.db-who > .db-mark { grid-column: 3; color: var(--ink3); transition: color var(--dur-140) var(--ease); }
a.db-who { min-height: var(--row); padding: var(--space-8) var(--space-12); border-radius: var(--radius-8); cursor: pointer; transition: background var(--dur-140) var(--ease); }
a.db-who:hover { background: var(--g-hover); }
a.db-who:hover > .db-mark { color: var(--live-text); }

/* Group: a set of rows in a list under its own band, which folds the set shut and open. The band stands on depth,
   never on a state's colour: the group's state is a status mark with its coloured word, beside its count and figure. */
.db-group { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; transition: grid-template-rows var(--dur-240) var(--ease); }
.db-group[data-folded] { grid-template-rows: auto 0fr; }
.db-group + .db-group { margin-top: var(--space-8); }
.db-group-band { min-width: 0; min-height: var(--h-36); padding: 0 var(--space-12); border-radius: var(--radius-8); background: var(--g2); color: var(--ink); font-size: var(--fs-label); font-weight: 500; text-align: left; display: flex; align-items: center; gap: var(--space-12); cursor: pointer; }
.db-group-band::before { content: ""; flex: none; width: 6px; height: 6px; margin: 0 2px 3px 2px; border-right: 1.5px solid var(--ink2); border-bottom: 1.5px solid var(--ink2); transform: rotate(45deg); transition: transform var(--dur-240) var(--ease-settle); }
.db-group[data-folded] > .db-group-band::before { transform: translate(-2px, 2px) rotate(-45deg); }
.db-group-band > :last-child:not(:first-child) { margin-left: auto; font-variant-numeric: tabular-nums; }
.db-group-fold { min-height: 0; padding-inline: var(--space-12); overflow: hidden; }
.db-group[data-folded] > .db-group-fold { visibility: hidden; transition: visibility 0s linear var(--dur-240); }

/* Rail: a narrow column. Its head (mark, name, state in a dot and its word) and its way stay put; every figure it is
   given stands between them, label above value at the rail's full width, and scrolls there when the rail is too short
   for them all. The lower edge of the figures fades, so one that is out of view is never taken for missing. */
.db-carry[data-form="rail"] { --mark: 44px; --carry-gap: var(--space-16); --carry-pad: var(--space-16) var(--space-8); width: 120px; min-height: 0; max-height: 100%; flex-direction: column; flex-wrap: nowrap; text-align: center; }
.db-carry[data-form="rail"] > * { flex: none; }
.db-carry[data-form="rail"] .db-carry-id, .db-carry[data-form="rail"] .db-carry-fig { align-items: center; gap: var(--space-8); }
.db-carry[data-form="rail"] .db-carry-name { font-size: var(--fs-label); }
.db-carry[data-form="rail"] .db-carry-state { flex-direction: column; gap: var(--space-4); font-size: var(--fs-label); text-align: center; }
.db-carry[data-form="rail"] .db-carry-figs { flex: 0 1 auto; min-height: var(--space-40); align-self: stretch; flex-direction: column; flex-wrap: nowrap; gap: var(--space-12); overflow: hidden auto; scrollbar-width: none; }
.db-carry[data-form="rail"] .db-carry-figs[data-more] { -webkit-mask-image: linear-gradient(#000 calc(100% - var(--space-40)), transparent); mask-image: linear-gradient(#000 calc(100% - var(--space-40)), transparent); }
.db-carry[data-form="rail"] .db-carry-figs::-webkit-scrollbar { display: none; }
.db-carry[data-form="rail"] .db-carry-fig { flex: none; gap: 2px; white-space: normal; font-size: var(--fs-label); overflow-wrap: anywhere; }
.db-carry[data-form="rail"] .db-carry-way { margin-top: auto; }
.db-carry[data-form="tile"] { --mark: 32px; --carry-gap: var(--space-12); --carry-pad: var(--space-16); align-content: flex-start; }
.db-carry[data-form="tile"] .db-carry-way { order: 1; margin-left: auto; }
.db-carry[data-form="tile"] .db-carry-id, .db-carry[data-form="tile"] .db-carry-figs { order: 2; flex: 1 1 100%; }
.db-carry[data-form="dock"] { --ground: var(--g3); --mark: 40px; --carry-gap: var(--space-8) var(--space-24); --carry-pad: var(--space-10) var(--space-12); border-radius: var(--radius-16); box-shadow: var(--depth-2); }
.db .db-carry[data-form="headline"]:not([data-ground]) { background: none; }
.db-carry[data-form="headline"] { --mark: 56px; --carry-gap: var(--space-20) var(--space-16); --carry-pad: 0px; border-radius: var(--radius-16); }
.db-carry[data-form="headline"][data-ground] { --carry-pad: var(--space-24); }
.db-carry[data-form="headline"] .db-carry-id { flex: 1 1 240px; gap: var(--space-4); }
.db-carry[data-form="headline"] .db-carry-name { font-weight: 700; font-size: var(--fs-title-l); line-height: 1.1; letter-spacing: -0.02em; }
.db-carry[data-form="headline"] .db-carry-figs { order: 1; flex: 1 1 100%; gap: var(--space-16) var(--space-40); }
.db-carry[data-form="headline"] .db-carry-fig > :last-child { font-size: var(--fs-figure); font-weight: 500; line-height: 1.1; letter-spacing: -0.025em; }
.db-carry[data-form="headline"] .db-carry-way { order: 2; flex: 1 1 100%; max-width: 560px; }
.db-carry[data-form="headline"][data-steps="down"] .db-carry-way { align-items: flex-start; }
.db .db-carry[data-form="chip"]:not([data-ground]) { background: color-mix(in srgb, var(--k, var(--ink3)) 14%, transparent); }
.db-carry[data-form="chip"] { --mark: 20px; --carry-gap: var(--space-6); --carry-pad: var(--space-4) var(--space-8); display: inline-flex; flex-wrap: nowrap; border-radius: var(--radius-8); vertical-align: middle; }
.db-carry[data-form="chip"]:has(> .db-carry-mark):not([data-hide~="mark"]) { --carry-pad: var(--space-4) var(--space-8) var(--space-4) var(--space-4); }
.db-carry[data-form="chip"] .db-carry-id { flex-direction: row; align-items: center; gap: var(--space-8); }
.db-carry[data-form="chip"] .db-carry-name { font-family: inherit; font-weight: 500; font-size: var(--fs-label); line-height: 1.3; }

/* State grounds: a block, a header, a tile or a cluster takes a state's colour as its
   whole ground (data-ground), and everything on it is recoloured to stay readable:
   words, lines, rings and the focus ring take the ground's ink (--on-ground: --on-signal,
   and --on-wait on a wait ground, whose raised steps are --wait-g2 and --wait-g3 and whose lit fills glow
   by --wait-glow), and a field, a
   raised part, a date tile, a chip, a meter, a ring or a kind's mark is drawn in
   that ink in place of its own colour.
   The colour stays: it is how the piece looks from then on. A soft light falls on
   it from above. When the state arrives it washes across the piece, left to right. */
.db [data-ground="live"] { --ground: var(--live-ground); }
.db [data-ground="wait"] { --ground: var(--wait-ground); }
.db [data-ground="bad"] { --ground: var(--bad-ground); }
.db [data-ground="ok"] { --ground: var(--ok-ground); }
.db [data-ground], .db .db-split-main[data-kind] { color: var(--ink);
  background-image: var(--shine, none), linear-gradient(color-mix(in srgb, var(--light-core) 10%, transparent), transparent 72%);
  --on-ground: var(--on-signal);
  --ink: var(--on-ground); --ink2: color-mix(in srgb, var(--on-ground) 88%, transparent); --ink3: color-mix(in srgb, var(--on-ground) 76%, transparent); --ink4: color-mix(in srgb, var(--on-ground) 30%, transparent);
  --hair: color-mix(in srgb, var(--on-ground) 14%, transparent); --hair2: color-mix(in srgb, var(--on-ground) 32%, transparent);
  --g-hover: color-mix(in srgb, var(--on-ground) 8%, transparent); --g-press: color-mix(in srgb, var(--on-ground) 14%, transparent);
  --solid: var(--on-ground); --onsolid: var(--ground); --on-fill: var(--on-ground); --on-mark: var(--ground);
  --live: var(--on-ground); --wait: var(--on-ground); --bad: var(--on-ground); --ok: var(--on-ground);
  --live-text: var(--on-ground); --wait-text: var(--on-ground); --bad-text: var(--on-ground); --ok-text: var(--on-ground);
  --live-wash: var(--g-press); --wait-wash: var(--g-press); --bad-wash: var(--g-press); --ok-wash: var(--g-press);
  --ring: inset 0 0 0 1px var(--hair2); --ring-soft: inset 0 0 0 1px var(--hair); --ring-hover: inset 0 0 0 1px var(--ink3);
  --focus: 0 0 0 3px color-mix(in srgb, var(--on-ground) 34%, transparent);
  --g2: color-mix(in srgb, var(--on-ground) 9%, transparent); --g3: color-mix(in srgb, var(--on-ground) 15%, transparent);
  --ring-field: inset 0 0 0 1.5px var(--on-ground);
  --data-1: color-mix(in srgb, var(--on-ground) 12%, transparent); --data-2: color-mix(in srgb, var(--on-ground) 28%, transparent); --data-3: color-mix(in srgb, var(--on-ground) 48%, transparent); --data-4: color-mix(in srgb, var(--on-ground) 72%, transparent); --data-5: var(--on-ground);
  --skel: color-mix(in srgb, var(--on-ground) 10%, transparent); --skel-lit: color-mix(in srgb, var(--on-ground) 20%, transparent);
  --pointer-light: color-mix(in srgb, var(--light-core) 9%, transparent); }
.db [data-ground="wait"], .db .db-split-main[data-ground="wait"] { --on-ground: var(--on-wait); --g2: var(--wait-g2); --g3: var(--wait-g3); --glow: var(--wait-glow); }
/* A chip of a kind on a wait ground stands on the ground's second raised step */
.db [data-ground="wait"] .db-chip[data-kind] { background: var(--wait-g3); }
/* On a ground a kind's colour gives way to the ground's ink: chips, kind marks, initials and every other piece drawn in --k */
.db [data-ground] :is([data-kind], .db-who-mark, .db-place-mark), .db [data-ground][data-kind] { --k: var(--on-ground); }
/* While a state washes across a piece nothing on it moves by itself, and the
   pictures the wash is made of are still: what is written arrives with the ground. */
.db [data-washing], .db [data-washing] *, .db [data-washing] *::before, .db [data-washing] *::after { transition: none !important; }
.db .db-wash-layer { margin: 0; pointer-events: none; }
.db-wash-layer, .db-wash-layer::before, .db-wash-layer::after, .db-wash-layer *, .db-wash-layer *::before, .db-wash-layer *::after { animation: none !important; transition: none !important; }

/* Thumb: a small picture of a thing, tinted with its kind until the picture is there */
.db-thumb { position: relative; flex: none; width: 40px; height: 40px; border-radius: var(--radius-8); overflow: hidden; display: grid; place-items: center; background: color-mix(in srgb, var(--k, var(--ink3)) 16%, var(--g2)); color: var(--k, var(--ink3)); }
.db-thumb svg, .db-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.db-thumb-count { position: absolute; right: var(--space-6); bottom: var(--space-6); height: var(--h-24); padding-inline: var(--space-8); border-radius: var(--radius-6); display: grid; place-items: center; background: color-mix(in srgb, var(--g0) 80%, transparent); color: var(--ink); font-size: var(--fs-label); font-weight: 500; }

/* Data table: things in rows, not a spreadsheet. No grid of lines and no wall of
   buttons: a quiet header that sorts, figures set in a column, a row that opens,
   and one action a row that shows on the row under the pointer (always, where
   there is no pointer). Rows can be chosen, a cell can be edited in place, a
   group of rows can carry a state as its ground, and the foot holds the totals.
   In a narrow place the columns marked data-wide and the pictures step aside; the row still opens the whole thing. */
.db-table-box { container-type: inline-size; min-width: 0; overflow-x: auto; }
@container (max-width: 640px) {
  .db-table [data-wide] { display: none; }
  .db-table th, .db-table td { padding-inline: var(--space-8); }
  .db-table-band { margin-inline: calc(var(--space-8) * -1); }
  .db-table tbody tr:is(:hover, [aria-selected="true"], .is-selected) td:nth-last-child(1 of :not([data-wide])) { border-radius: 0 var(--radius-8) var(--radius-8) 0; }
}
.db-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.db-table th, .db-table td { padding: var(--space-10) var(--space-12); text-align: left; vertical-align: middle; font-weight: 400; }
.db-table [data-num] { text-align: right; font-variant-numeric: tabular-nums; }
.db-table [data-num], .db-table .db-num, .db-table .db-status, .db-table .db-edit { white-space: nowrap; }
.db-table thead th { padding-block: var(--space-6); font-size: var(--fs-label); color: var(--ink3); white-space: nowrap; }
.db-sort { padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: var(--space-6); transition: color var(--dur-140) var(--ease); }
.db-sort:hover, th[aria-sort] .db-sort { color: var(--ink); }
.db-sort::after { content: ""; border-inline: 4px solid transparent; border-bottom: 6px solid currentColor; opacity: 0; transition: transform var(--dur-240) var(--ease-settle), opacity var(--dur-140) var(--ease); }
th[aria-sort] .db-sort::after { opacity: 1; }
th[aria-sort="descending"] .db-sort::after { transform: rotate(180deg); }
.db-table tbody tr { cursor: pointer; }
.db-table tbody td { box-shadow: inset 0 1px 0 var(--hair); transition: background var(--dur-140) var(--ease); }
.db-table tbody tr:is(:hover, [aria-selected="true"], .is-selected) td:first-child { border-radius: var(--radius-8) 0 0 var(--radius-8); }
.db-table tbody tr:is(:hover, [aria-selected="true"], .is-selected) td:last-child { border-radius: 0 var(--radius-8) var(--radius-8) 0; }
.db-table tbody tr:hover td { background: var(--g-hover); }
.db-table tbody tr:is([aria-selected="true"], .is-selected) td { background: var(--live-wash); }
.db-table tbody tr:first-child td, .db-table tbody tr:hover td, .db-table tbody tr:hover + tr td, .db-table tr:is([aria-selected="true"], .is-selected) td, .db-table tr:is([aria-selected="true"], .is-selected) + tr td, .db-table-group + tr td { box-shadow: none; }
.db-table-lead { display: flex; align-items: center; gap: var(--space-12); min-width: 0; }
.db-table-lead b { font-weight: 500; }
.db-table .db-check { transition: opacity var(--dur-140) var(--ease), background var(--dur-140) var(--ease), box-shadow var(--dur-140) var(--ease); }
.db-table-acts, .db-table :is(th, td):has(> .db-check) { width: 1%; white-space: nowrap; }
.db-table-acts { text-align: right; }
.db-table :is(th, td):has(> .db-check) { padding-right: 0; }
.db[data-mouse] .db-table .db-check, .db[data-mouse] .db-table-acts .db-btn { opacity: 0; }
.db[data-mouse] .db-table tr:hover .db-check, .db[data-mouse] .db-table .db-check:checked, .db[data-mouse] .db-table .db-check:focus-visible, .db[data-mouse] .db-table[data-choosing] .db-check, .db[data-mouse] .db-table tbody tr:hover .db-table-acts .db-btn, .db[data-mouse] .db-table-acts .db-btn:focus-visible, .db[data-mouse] .db-table-acts .db-btn[data-busy], .db[data-mouse] .db-table-acts .db-btn[data-done] { opacity: 1; }
.db-table-group { cursor: default; }
.db-table .db-table-group th { padding: var(--space-20) var(--space-12) var(--space-6); font-size: var(--fs-label); color: var(--ink3); }
.db-table-band { display: flex; align-items: center; gap: var(--space-16); padding: var(--space-8) var(--space-12); margin-inline: calc(var(--space-12) * -1); border-radius: var(--radius-8); background: var(--g2); color: var(--ink2); }
.db-table-band > :last-child:not(:first-child) { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--ink); }
.db-table tfoot td { padding-top: var(--space-12); box-shadow: inset 0 1px 0 var(--hair2); font-weight: 500; }
/* A cell that can be edited where it stands: press it, type, and it flashes when kept */
.db-edit { margin: -3px calc(var(--space-8) * -1); padding: 3px var(--space-8); border: 0; border-radius: var(--radius-6); background: none; font: inherit; color: inherit; font-variant-numeric: tabular-nums; cursor: text; transition: box-shadow var(--dur-140) var(--ease); }
.db-edit:hover { box-shadow: var(--ring); }
/* An emptied cell shows blank and keeps room to be pressed */
.db-edit:empty { min-width: var(--space-56); min-height: var(--h-24); }
.db-edit-input { height: var(--h-28); margin: -3px calc(var(--space-8) * -1); padding-inline: var(--space-8); text-align: inherit; font-variant-numeric: tabular-nums; }
/* The bar that rises from the bottom while rows are chosen */
.db-selbar { --ground: var(--g3); position: fixed; z-index: 55; left: 50%; bottom: max(var(--space-24), env(safe-area-inset-bottom, 0px)); translate: -50% 0; max-width: calc(100vw - var(--space-32)); display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-8); padding: var(--space-8) var(--space-8) var(--space-8) var(--space-16); border-radius: var(--radius-16); box-shadow: var(--depth-2); animation: db-up var(--dur-420) var(--ease-settle); }
.db-selbar[data-leaving] { animation: db-down var(--dur-240) var(--ease) forwards; }
/* While a sheet or a tray is open the bar stands aside, below the window's edge */
.db-selbar { transition: translate var(--dur-240) var(--ease), opacity var(--dur-240) var(--ease), visibility 0s; }
.db-selbar[data-aside] { translate: -50% calc(100% + var(--space-40)); opacity: 0; visibility: hidden; pointer-events: none; transition: translate var(--dur-240) var(--ease), opacity var(--dur-240) var(--ease), visibility 0s linear var(--dur-240); }
.db-selbar > :first-child { margin-right: var(--space-12); font-variant-numeric: tabular-nums; }

/* Picture strip: pictures in a row, each with its name and how many pages; one opens in the viewer */
.db-strip { display: flex; gap: var(--space-12); overflow-x: auto; padding-bottom: var(--space-4); }
.db-strip-item { flex: none; width: 148px; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: var(--space-6); }
.db-strip-item .db-thumb { width: 148px; height: 108px; border-radius: var(--radius-12); transition: transform var(--dur-240) var(--ease-settle); }
.db-strip-item:hover .db-thumb { transform: translateY(-3px); }
.db-strip-name { font-weight: 500; overflow-wrap: anywhere; }
/* A file that is not a picture, in a strip: the mark and the word of its sort stand where a picture would. The
   item is a link to the file, and the viewer passes over it. */
a.db-strip-item { text-decoration: none; }
.db-thumb--file { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-6); color: var(--ink2); }
.db-thumb--file > .db-mark { width: 28px; height: 28px; }
.db-thumb-sort { font-size: var(--fs-label); font-weight: 600; letter-spacing: 0.04em; }
.db-sheet.db-viewer { width: min(920px, calc(100vw - 32px)); padding: var(--space-16); gap: var(--space-12); }
.db-viewer-head { display: flex; align-items: center; gap: var(--space-12); padding-left: var(--space-8); }
.db-viewer-head > :first-child { margin-right: auto; }
.db-viewer-stage { aspect-ratio: 4 / 3; max-height: 68vh; border-radius: var(--radius-12); overflow: hidden; background: color-mix(in srgb, var(--k, var(--ink3)) 16%, var(--g1)); color: var(--k, var(--ink3)); }
.db-viewer-stage svg, .db-viewer-stage img { display: block; width: 100%; height: 100%; object-fit: contain; }

/* Document: a page of paper, the same in both colourways, for a preview beside a message. It keeps a page's
   proportions while its lines fit and grows when they do not. Inside .db-doc-pages it is kept to whole pages,
   one under another, each with its number. */
.db-doc { position: relative; aspect-ratio: 17 / 22; padding: 9% 8%; border-radius: var(--radius-3); background: var(--page); color: var(--on-page); box-shadow: var(--depth-2); display: flex; flex-direction: column; gap: var(--space-16); font-size: var(--fs-label);
  --ink: var(--on-page); --ink2: color-mix(in srgb, var(--on-page) 76%, transparent); --ink3: color-mix(in srgb, var(--on-page) 60%, transparent); --ink4: color-mix(in srgb, var(--on-page) 24%, transparent);
  --hair: color-mix(in srgb, var(--on-page) 12%, transparent); --hair2: color-mix(in srgb, var(--on-page) 24%, transparent); --g-hover: transparent; }
.db-doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-16); }
.db-doc-head b { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-lead); }
.db-doc .db-table th, .db-doc .db-table td { padding: var(--space-6) 0; }
.db-doc .db-table tbody tr { cursor: default; }
.db-doc-foot { margin-top: auto; color: var(--ink3); }
.db-doc-pages { display: flex; flex-direction: column; gap: var(--space-16); min-width: 0; }
.db-doc-pages > .db-doc { flex: none; overflow: hidden; }
/* A document that comes as pictures of its pages: one picture a page (.db-doc-pic, an img or an svg), stacked in
   .db-doc-pages. Each stands at the full width in its own proportions, so the document runs to as many pages as
   it has and nothing scrolls inside a page. */
.db-doc-pic { display: block; flex: none; width: 100%; height: auto; border-radius: var(--radius-3); background: var(--page); color: var(--on-page); box-shadow: var(--depth-2); }
.db-doc-no { position: absolute; right: 8%; bottom: 3.5%; color: var(--ink3); font-variant-numeric: tabular-nums; }
.db-textarea, :where(.db) textarea:not([class]) { height: auto; min-height: 132px; padding-block: var(--space-10); line-height: 1.5; resize: none; }

/* People field: the people chosen as chips, and a list that finds as you type. The find field (.db-find) is drawn in the same box,
   its line as the people field's own, its chips as a person and its controls that take something off as a person's */
.db-people, .db-find { min-height: var(--h-36); padding: var(--space-4) var(--space-8) var(--space-4) var(--space-12); border-radius: var(--radius-8); background: var(--g2); box-shadow: var(--ring-soft); display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-6); cursor: text; transition: box-shadow var(--dur-140) var(--ease), background var(--dur-140) var(--ease); }
.db-people:hover, .db-find:hover { box-shadow: var(--ring); }
.db .db-people:focus-within, .db .db-find:focus-within { box-shadow: var(--ring-field), var(--focus); background: var(--g3); }
.db-people > .db-label { margin-right: var(--space-4); }
.db-people > input, .db-find-line { flex: 1; width: auto; min-width: 48px; height: var(--h-28); padding: 0; border: 0; border-radius: 0; outline: none; background: none; box-shadow: none; color: inherit; font: inherit; }
.db .db-people > input:focus-visible, .db .db-find > .db-find-line:focus-visible { box-shadow: none; }
.db-person, .db-find-chip { padding: 0 2px 0 var(--space-8); border-radius: var(--radius-6); background: var(--g-press); display: inline-flex; align-items: center; gap: 2px; font-size: var(--fs-label); font-weight: 500; }
.db-person { height: 26px; white-space: nowrap; }
.db-person > button, .db-file-off, .db-find-off { flex: none; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.db-person > button, .db-file-off { position: relative; }
.db-person > button:hover, .db-file-off:hover, .db-find-off:hover { background: var(--ink4); }
.db-person > button::before, .db-person > button::after, .db-file-off::before, .db-file-off::after { content: ""; position: absolute; left: 50%; top: 50%; width: 9px; height: 1.5px; margin: -0.75px 0 0 -4.5px; border-radius: 1px; background: var(--ink2); transform: rotate(45deg); }
.db-person > button::after, .db-file-off::after { transform: rotate(-45deg); }
.db-menu.db-people-list { max-height: min(260px, var(--room, 260px)); }
/* As a pick of several the field ends in the pick list's mark; its list marks the ones chosen as every menu does */
.db-people[data-several] { padding-right: var(--space-32); position: relative; cursor: pointer; }
.db-people[data-several]::after { content: ""; position: absolute; right: 14px; top: 13px; width: 7px; height: 7px; border-right: 1.5px solid var(--ink3); border-bottom: 1.5px solid var(--ink3); transform: rotate(45deg); }

/* Time field: a pick list of times; its mark is a clock face */
.db-time .db-pick-btn::after { width: 13px; height: 13px; margin-right: 0; border: 0; border-radius: 50%; background: linear-gradient(var(--ink3), var(--ink3)) 50% 3.5px / 1.5px 3.5px no-repeat, linear-gradient(var(--ink3), var(--ink3)) 8px 50% / 3px 1.5px no-repeat; box-shadow: inset 0 0 0 1.5px var(--ink3); transform: none; }
.db-time .db-pick-btn[aria-expanded="true"]::after { transform: none; }
.db-time .db-pick-list > button { font-variant-numeric: tabular-nums; }
/* Date and time as one control: the day and the time side by side */
.db-when { display: flex; flex-wrap: wrap; gap: var(--space-8); min-width: 0; }
.db-when > .db-date { flex: 3 1 184px; }
.db-when > .db-time { flex: 2 1 124px; }
.db-when > .db-field-error { flex: 1 1 100%; }

/* File control: the press to choose files, which also takes files dropped on it, and a line for each file chosen */
.db-files { display: flex; flex-direction: column; gap: var(--space-8); min-width: 0; }
.db-files > input[type="file"] { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; opacity: 0; overflow: hidden; clip-path: inset(50%); pointer-events: none; }
.db-files-drop { min-height: var(--space-56); padding: var(--space-12) var(--space-16); border-radius: var(--radius-8); background: var(--g2); box-shadow: var(--ring-soft); color: var(--ink2); display: flex; align-items: center; justify-content: center; gap: var(--space-8); text-align: center; cursor: pointer; transition: box-shadow var(--dur-140) var(--ease), background var(--dur-140) var(--ease), color var(--dur-140) var(--ease); }
.db-files-drop:hover { box-shadow: var(--ring); color: var(--ink); }
.db .db-files > input:focus-visible + .db-files-drop { box-shadow: var(--ring-field), var(--focus); background: var(--g3); color: var(--ink); }
.db-files[data-over] > .db-files-drop { box-shadow: var(--ring-field); background: var(--live-wash); color: var(--ink); }
.db-files-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--space-4); }
.db-files-list:empty { display: none; }
.db-file { min-height: var(--row); padding: var(--space-4) var(--space-8) var(--space-4) var(--space-4); border-radius: var(--radius-8); background: var(--g2); display: flex; align-items: center; gap: var(--space-12); min-width: 0; }
.db-file-pic { flex: none; width: 36px; height: 36px; border-radius: var(--radius-6); overflow: hidden; background: var(--g-press); color: var(--ink3); display: grid; place-items: center; }
.db-file-pic canvas { width: 100%; height: 100%; display: block; }
.db-file-name { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-file-size { flex: none; font-size: var(--fs-label); color: var(--ink3); font-variant-numeric: tabular-nums; }
.db-menu > button > .db-muted { margin-left: auto; font-size: var(--fs-label); }
/* In a list that finds as you type, the choice the arrows are on */
.db [data-active] { background: var(--g-hover); }

/* Month calendar: dated things by kind, today marked, each one a click away.
   In a narrow place each thing is a short bar of its kind's colour, without its words. */
.db-month-box { container-type: inline-size; min-width: 0; }
.db-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.db-month-name { padding: 0 var(--space-8) var(--space-6); font-size: var(--fs-label); color: var(--ink3); }
.db-month-day { min-width: 0; min-height: 124px; padding: var(--space-8); border-radius: var(--radius-8); background: var(--g-hover); display: flex; flex-direction: column; align-items: stretch; gap: 3px; }
.db-month-day[data-out] { background: none; }
.db-month-n { align-self: flex-start; min-width: 24px; height: 24px; padding-inline: var(--space-6); border-radius: var(--radius-pill); display: grid; place-items: center; font-size: var(--fs-label); font-variant-numeric: tabular-nums; color: var(--ink2); }
.db-month-day[data-out] .db-month-n { color: var(--ink3); }
.db-month-day[aria-current="date"] .db-month-n { background: var(--live); color: var(--on-signal); font-weight: 600; }
.db-month-item { min-height: 26px; padding: var(--space-4) var(--space-8); border: 0; border-radius: var(--radius-6); background: color-mix(in srgb, var(--k, var(--ink3)) 22%, transparent); color: var(--ink); font: inherit; font-size: var(--fs-label); font-weight: 500; line-height: 1.3; text-align: left; overflow-wrap: anywhere; cursor: pointer; transition: background var(--dur-140) var(--ease); }
.db-month-item:hover { background: color-mix(in srgb, var(--k, var(--ink3)) 36%, transparent); }
/* A day that can be clicked: under its number one bar for each kind it holds, as long as that kind's share (data-v), with
   the count beside it; a mark at its corner says something on it is late */
button.db-month-day { position: relative; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background var(--dur-140) var(--ease); }
button.db-month-day:hover { background: var(--g-press); }
.db-month-kind { min-height: var(--space-16); display: flex; align-items: center; gap: var(--space-6); font-size: var(--fs-label); line-height: 1; font-variant-numeric: tabular-nums; color: var(--ink2); }
.db-month-kind::before { content: ""; flex: 0 1 calc((100% - var(--space-24)) * var(--v, 100) / 100); min-width: var(--space-6); height: 4px; border-radius: var(--radius-pill); background: var(--k, var(--ink3)); }
.db-month-late { position: absolute; top: var(--space-12); right: var(--space-10); width: 8px; height: 8px; border-radius: 2px; background: var(--bad); transform: rotate(45deg); }
@container (max-width: 600px) {
  .db-month-day { min-height: 72px; padding: var(--space-6); }
  .db-month-name { padding-inline: var(--space-4); }
  .db-month-item { min-height: 7px; height: 7px; padding: 0; border-radius: var(--radius-pill); background: var(--k, var(--ink3)); font-size: 0; }
  .db-month-item:hover { background: var(--k, var(--ink3)); opacity: 0.7; }
}

/* Search palette: one field over the veil that finds things of every kind, grouped by kind */
.db-sheet.db-palette { top: 12vh; translate: -50% 0; width: min(640px, calc(100vw - 32px)); max-height: 72vh; padding: var(--space-12); gap: var(--space-4); }
.db-palette-list { min-height: 0; overflow: auto; overscroll-behavior: contain; display: flex; flex-direction: column; }
.db-palette-group { display: flex; flex-direction: column; padding-top: var(--space-12); }
.db-palette-group > .db-label { padding: 0 var(--space-10) var(--space-4); }
.db-palette-group > button { min-height: 40px; padding: var(--space-6) var(--space-10); border: 0; border-radius: var(--radius-8); background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; display: flex; align-items: center; gap: var(--space-12); }
.db-palette-group > button > .db-muted { margin-left: auto; font-size: var(--fs-label); }
.db-palette-none { padding: var(--space-16) var(--space-10); }

/* Messages. A field that is wrong says so beneath itself; a part that failed says so in
   its own place and offers to try again; and what went well needs no box: its button
   shows a check and moves on. */
.db .db-input[aria-invalid="true"], .db .db-pick-btn[aria-invalid="true"], .db .db-date-btn[aria-invalid="true"], .db .db-files > input[aria-invalid="true"] + .db-files-drop { box-shadow: inset 0 0 0 1.5px var(--bad); }
.db .db-input[aria-invalid="true"]:focus, .db :is(.db-pick-btn, .db-date-btn)[aria-invalid="true"]:focus-visible, .db .db-files > input[aria-invalid="true"]:focus-visible + .db-files-drop { box-shadow: inset 0 0 0 1.5px var(--bad), var(--focus); }
.db-field-error { display: inline-flex; align-items: center; gap: var(--space-8); font-size: var(--fs-label); font-weight: 500; color: var(--bad-text); }
.db-field-error::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 2px; background: var(--bad); transform: rotate(45deg); }
.db-fault { padding: var(--space-16); border-radius: var(--radius-12); background: var(--bad-wash); display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-12); }
/* Past a rule: why, then go ahead. The screen that needs this box builds it; these classes
   give the look to whatever carries them: the box, its title, the short list of rules it
   passes, and the line that holds the reason and the button. */
.db-warn { margin: 0; padding: var(--space-16); border-radius: var(--radius-12); background: var(--wait-wash); display: flex; flex-direction: column; gap: var(--space-10); text-align: left; }
.db-row + .db-warn, tr + .db-warn { margin-block: var(--space-4) var(--space-12); }
/* Under a row the box runs to the row's own edges */
.db-row + .db-warn { margin-inline: calc(var(--space-12) * -1); }
.db-warn-title { margin: 0; font-weight: 500; }
.db-warn-rules { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--space-4); color: var(--ink2); }
.db-warn-rules > * { margin: 0; display: flex; align-items: baseline; gap: var(--space-8); }
.db-warn-rules > *::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 2px; background: var(--wait); transform: translateY(-2px) rotate(45deg); }
.db-warn-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-8); }
.db-warn-row > .db-input { flex: 1 1 220px; width: auto; min-width: 0; }
.db-warn-row > .db-btn { flex: none; }
.db-btn[data-done] { position: relative; color: transparent; pointer-events: none; }
.db-btn[data-done]::after { content: ""; position: absolute; inset: 0; margin: auto; width: 13px; height: 7px; border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: translateY(-2px) rotate(-45deg); animation: db-pop var(--dur-240) var(--ease-settle); }
.db-btn--solid[data-done]::after { border-color: var(--onsolid); }

/* Nothing here yet: says what will appear and offers the first move */
.db-empty { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-12); padding: var(--space-32) 0; }
.db-empty-mark { width: 44px; height: 44px; border-radius: var(--radius-12); background: var(--g-press); display: grid; place-items: center; color: var(--ink3); }

/* A part that is being fetched keeps its place and dims */
.db-part[aria-busy="true"] { opacity: 0.55; transition: opacity var(--dur-140) var(--ease); pointer-events: none; }

/* Entry table: a table whose lines are typed in. Its rows do not open, so they keep their
   lines and take no ground under the pointer; each cell is as tall as one control. */
.db-cells tbody tr { cursor: default; }
.db-table.db-cells tbody tr:hover td { background: none; border-radius: 0; }
.db-table.db-cells tbody tr:not(:first-child) td { box-shadow: inset 0 1px 0 var(--hair); }
.db-table.db-cells tbody td { padding-block: var(--space-6); }
/* Figures keep a narrow column apiece and the words take the rest of the table */
.db-cells :is(th, td)[data-num] { width: 136px; }
.db-cells tbody tr[data-new] { animation: db-line-in var(--dur-420) var(--ease) backwards; }
@keyframes db-line-in { from { opacity: 0; transform: translateY(8px); } }
/* Cell: a real named input that reads as the table's own words until the pointer or the keys
   reach it, when it shows itself as a field. A money or number cell shows its value written
   out (the unit, the thousands) while it rests, and the bare figures while it is typed in. */
.db-cell { position: relative; display: block; margin-inline: calc(var(--space-8) * -1); border-radius: var(--radius-6); }
.db-cell-input { display: block; width: 100%; height: var(--h-32); margin: 0; padding: 0 var(--space-8); border: 0; border-radius: var(--radius-6); outline: none; background: none; box-shadow: none; color: inherit; font: inherit; font-variant-numeric: tabular-nums; text-align: inherit; appearance: none; transition: box-shadow var(--dur-140) var(--ease), background var(--dur-140) var(--ease); }
/* Words that may run long are a one-line text area: it grows to hold them all, so a name is never cut */
textarea.db-cell-input { min-height: var(--h-32); padding-block: 5px; line-height: 22px; resize: none; overflow: hidden; overflow-wrap: anywhere; }
.db-cell-input::placeholder { color: var(--ink3); opacity: 1; }
.db-cell-input:hover { box-shadow: var(--ring); }
.db .db-cell-input:focus { box-shadow: var(--ring-field), var(--focus); background: var(--g3); }
.db-cell-input:disabled { color: var(--ink3); box-shadow: none; }
.db-cell-face { position: absolute; inset: 0; padding-inline: var(--space-8); display: flex; align-items: center; justify-content: flex-end; white-space: nowrap; font-variant-numeric: tabular-nums; pointer-events: none; }
.db-cell-face:empty { display: none; }
.db-cell-face:not(:empty) ~ .db-cell-input:not(:focus), .db-cell-face:not(:empty) ~ .db-cell-input:not(:focus)::placeholder { color: transparent; }
.db-cell:focus-within > .db-cell-face { visibility: hidden; }
.db-cell:has(> .db-cell-input:disabled) > .db-cell-face { color: var(--ink3); }
/* A bad value: the cell is ringed and washed where it stands; its words float under it and take no room in the row */
.db .db-cell-input[aria-invalid="true"] { box-shadow: inset 0 0 0 1.5px var(--bad); background: var(--bad-wash); }
.db .db-cell-input[aria-invalid="true"]:focus { box-shadow: inset 0 0 0 1.5px var(--bad), var(--focus); }
.db-cell-say { position: fixed; inset: auto; z-index: 30; margin: 0; padding: var(--space-6) var(--space-10); border: 0; border-radius: var(--radius-8); background: var(--g3); color: var(--bad-text); box-shadow: var(--depth-2); font-size: var(--fs-label); font-weight: 500; white-space: nowrap; display: flex; align-items: center; gap: var(--space-8); overflow: visible; pointer-events: none; animation: db-cell-say-in var(--dur-240) var(--ease-settle); }
.db-cell-say:not(:popover-open) { display: none; }
.db-cell-say::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 2px; background: var(--bad); transform: rotate(45deg); }
@keyframes db-cell-say-in { from { opacity: 0; transform: translateY(-4px) scale(0.97); } }
/* A figure the table works out (a line's total, a column's sum): it stands where a cell would */
.db-cell-out { display: block; min-height: var(--h-32); line-height: var(--h-32); margin-inline: calc(var(--space-8) * -1); padding-inline: var(--space-8); border-radius: var(--radius-6); font-variant-numeric: tabular-nums; white-space: nowrap; }
.db-cell-out.db-money { display: flex; justify-content: flex-end; min-height: 0; line-height: 1.1; }
/* Waiting: a cell keeps its room, so no row moves when it lands; its shape is a bar the height of a line of words, short for a figure */
.db-cell.db-skel, .db-cell-out.db-skel { clip-path: inset(5px 36% 5px 0 round var(--radius-6)); }
td[data-num] > :is(.db-cell, .db-cell-out).db-skel { clip-path: inset(5px 0 5px calc(100% - 72px) round var(--radius-6)); }

/* Filter pick: the kit's pick list in a smaller dress, for a quiet line of them over a list.
   Its label stands inside it in label ink, before the choice in reading ink. It carries the
   kit's filter mark: a dot at rest, a check while it holds a choice, when its clear control
   stands where the list's mark stood. A line of them breaks on to a further line when it must. */
.db-filter-line { display: flex; flex-wrap: wrap; gap: var(--space-8); min-width: 0; }
.db-filter { flex: 0 1 auto; max-width: 100%; }
.db-filter > .db-pick-btn { width: auto; max-width: 100%; height: var(--h-32); padding-inline: var(--space-8) var(--space-10); gap: var(--space-6); background: var(--g2); box-shadow: none; }
.db-filter > .db-pick-btn:hover { box-shadow: var(--ring); }
.db-filter-label { flex: none; color: var(--ink3); }
.db-filter .db-pick-value { flex: 0 1 auto; }
.db-filter[data-on] .db-pick-value { font-weight: 500; }
.db-filter > .db-clear { top: 6px; right: var(--space-6); }
.db-filter:has(> .db-clear:not([hidden])) > .db-pick-btn { padding-right: var(--space-6); }
.db-filter:has(> .db-clear:not([hidden])) > .db-pick-btn::after { display: none; }
.db-filter > .db-pick-btn:disabled { opacity: var(--op-disabled); pointer-events: none; }
.db-filter.db-skel { border-radius: var(--radius-8); }

/* Date rail: the days a thing passes through as a line of small date tiles, each with its
   label above its day in words. The line between two tiles says how many days lie between
   them; what lies behind today is drawn stronger, and a dot stands where today falls. A tile
   may be the kit's date field itself: it carries a control's ring, and a click on it opens
   the calendar. An empty one shows the calendar mark and nothing else. */
.db-dateline { margin: 0; padding: 0; list-style: none; display: flex; min-width: 0; overflow-x: auto; }
.db-dateline-stop { --tile: 40px; flex: 1 1 0; min-width: 132px; position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-8); padding: var(--space-8) var(--space-16) 3px 3px; }
.db-dateline-stop:last-child { flex: 0 1 auto; padding-right: var(--space-12); }
.db-dateline-stop::before { content: ""; position: absolute; top: calc(var(--space-8) + var(--tile) / 2 - 1px); left: calc(3px + var(--tile) + var(--space-8)); right: var(--space-8); height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--ink2) calc(var(--passed, 0) * 100%), var(--ink4) 0); }
.db-dateline-stop:last-child::before { display: none; }
/* Today, where it falls between two stops: a lit dot on the line and the word under it */
.db-dateline-today { --at: calc(3px + var(--tile) + var(--space-8) + (100% - 3px - var(--tile) - var(--space-16)) * var(--passed, 0)); position: absolute; top: calc(var(--space-8) + var(--tile) / 2 + 9px); left: clamp(3px + var(--tile) + var(--space-4), var(--at) - 24px, 100% - 52px); width: 48px; text-align: center; font-size: var(--fs-label); line-height: 16px; color: var(--live-text); white-space: nowrap; pointer-events: none; }
.db-dateline-stop[data-between]::after { content: ""; position: absolute; top: calc(var(--space-8) + var(--tile) / 2 - 5px); left: calc(3px + var(--tile) + var(--space-8) + (100% - 3px - var(--tile) - var(--space-16)) * var(--passed, 0) - 5px); width: 10px; height: 10px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 3px var(--ground, var(--g0)), 0 0 12px color-mix(in srgb, var(--live) var(--glow), transparent); }
.db-dateline-gap { position: absolute; top: calc(var(--space-8) + var(--tile) / 2 - 22px); left: calc((100% + var(--tile)) / 2); translate: -50% 0; font-size: var(--fs-label); line-height: 18px; color: var(--ink3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.db-dateline-gap[data-back] { color: var(--bad-text); }
.db-dateline-stop[aria-current="date"] .db-datetile { box-shadow: var(--ring-field); }
.db-dateline-what { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.db-dateline-set { align-self: stretch; display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-8); }
.db-dateline-set > .db-date-btn { gap: 0; padding-inline: 0; text-align: center; }
.db-dateline-set > .db-date-btn::after { display: none; }
.db-dateline-set > .db-date-btn:has(.db-datetile-day:empty)::after { display: block; }
.db-dateline-set > .db-date-btn:has(.db-datetile-day:empty) > * { display: none; }
.db-dateline-set > .db-date-btn:disabled { opacity: var(--op-disabled); pointer-events: none; }
.db-dateline-set > .db-clear { top: -6px; left: calc(var(--tile) - 12px); right: auto; background: var(--g3); box-shadow: var(--depth-1); }
.db-dateline-set > .db-clear:hover { background: var(--g3); box-shadow: var(--depth-1), var(--ring); }
/* Waiting: the tiles and the words are shapes, and the line between them is not drawn */
.db-dateline-stop:has(.db-skel)::before, .db-dateline-stop:has(.db-skel)::after, .db-dateline-stop:has(.db-skel) > :is(.db-dateline-gap, .db-dateline-today), .db-dateline-set:has(.db-skel) > .db-clear { visibility: hidden; }

/* Seven pieces that find and show things.
     find field       .db-find         a typed line that finds, with a floating list or a part of the page it feeds
     week of days     .db-weekly       a column a day, each large enough to work in
     shares bar       .db-shares       one bar in parts of a whole, with a floor a whole must reach
     lanes over time  .db-spans        a lane for each thing across a scale of weeks
     year strip       .db-heat-year    the heat strip in one row
     well of pages    .db-well         a place for a document's pages to scroll in, and .db-pagemark
     settings row     .db-setting      a list row that carries to its page */

/* Find field: a typed line that finds, and a floating list of what it found. One choice shows in
   the line; several stand before the line as chips, each with its own control to take it off. */
.db-find { position: relative; min-width: 0; transition: box-shadow var(--dur-140) var(--ease), background var(--dur-140) var(--ease), opacity var(--dur-140) var(--ease); }
.db-find > .db-mark { color: var(--ink3); margin-right: 2px; }
.db-find-line { min-width: 64px; margin: 0; appearance: none; }
.db-find-line::placeholder { color: var(--ink3); opacity: 1; }
.db-find:has(> .db-find-line:disabled) { opacity: var(--op-disabled); pointer-events: none; }
/* The control that takes something off: a chip from the field, or the one choice a field may go without */
.db-find-off { color: var(--ink2); display: grid; place-items: center; transition: background var(--dur-140) var(--ease), color var(--dur-140) var(--ease); }
.db-find-off:hover { color: var(--ink); }
.db-find-off > .db-mark { width: 14px; height: 14px; }
.db-find > .db-find-off { background: var(--g-press); }
.db-find > .db-find-off:hover { background: var(--ink4); }
.db-find-chip { max-width: 100%; min-height: 26px; padding-block: 2px; line-height: 1.3; cursor: default; }
.db-find-chip > span { min-width: 0; overflow-wrap: anywhere; }
.db-find-chip[data-kind]::before, .db-find-opt[data-kind]::before { content: ""; flex: none; width: 6px; height: 6px; margin-right: var(--space-4); border-radius: 50%; background: var(--k); }
.db-menu.db-find-list { max-height: min(300px, var(--room, 300px)); }
.db-find-opt { min-height: var(--h-32); padding: var(--space-4) var(--space-10); border-radius: var(--radius-6); line-height: 1.4; display: flex; align-items: center; gap: var(--space-12); cursor: pointer; }
.db-find-opt[data-kind]::before { margin-right: calc(var(--space-4) * -1); }
.db-find-name { min-width: 0; overflow-wrap: anywhere; }
.db-find-name > b { font-weight: 600; }
.db-find-opt > .db-muted { flex: none; margin-left: auto; font-size: var(--fs-label); white-space: nowrap; }
.db-find-opt[aria-selected="true"] { font-weight: 500; }
.db-find-opt[aria-selected="true"]::after { content: ""; flex: none; width: 10px; height: 6px; margin-left: auto; border-left: 2px solid var(--live); border-bottom: 2px solid var(--live); transform: translateY(-2px) rotate(-45deg); }
.db-find-opt[aria-selected="true"] > .db-muted + *, .db-find-opt[aria-selected="true"]:has(> .db-muted)::after { margin-left: 0; }
.db-find-fig { flex: none; margin-left: auto; font-size: var(--fs-label); font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink2); }
.db-find-opt > .db-muted + .db-find-fig { margin-left: 0; }
.db-find-none, .db-find-head { display: block; padding: var(--space-6) var(--space-10); }
/* A part of a page fed by a find field: an overview at rest, and the list of what the words find.
   A result there is the same compact line, a step lower, so thirty stand on a screen; each rises in. */
.db-found { min-width: 0; }
.db-found-list { margin-inline: calc(var(--space-10) * -1); display: flex; flex-direction: column; }
.db-found:not([data-finding]) > .db-found-list, .db-found[data-finding] > .db-found-rest { display: none; }
.db-found:not([data-finding]) > .db-found-rest { animation: db-fade var(--dur-240) var(--ease); }
.db-found-list > .db-find-opt { min-height: var(--h-28); padding-block: 0; animation: db-rise var(--dur-420) var(--ease) backwards; animation-delay: calc(min(var(--i, 0), 14) * 16ms); }
.db-found-list > .db-find-opt > .db-muted { margin-left: 0; }
.db-found-list > .db-find-opt > .db-find-fig { margin-left: auto; }
/* While the list is being fetched it holds the shape of what is coming: three lines of unequal length */
.db-find-wait { height: var(--h-32); padding-inline: var(--space-10); display: flex; align-items: center; }
.db-find-wait > i { width: 58%; height: 12px; }
.db-find-wait:nth-child(2) > i { width: 82%; }
.db-find-wait:nth-child(3) > i { width: 44%; }

/* A word about the thing under the pointer or the keys' mark: a small solid label in the top layer, over it */
.db .db-tip { position: fixed; inset: auto; margin: 0; border: 0; max-width: min(300px, calc(100vw - var(--space-16))); padding: var(--space-4) var(--space-8); border-radius: var(--radius-6); background: var(--solid); color: var(--onsolid); font-size: var(--fs-label); line-height: 1.4; white-space: pre-line; overflow: visible; pointer-events: none; box-shadow: var(--depth-2); animation: db-fade var(--dur-140) var(--ease); }

/* Week of days: seven columns, a day each, each large enough to work in. A column holds its day's
   entries, each with the mark of its kind, its time, and its name on up to two lines. Today's column
   is raised. */
.db-weekly { min-width: 0; display: flex; flex-direction: column; gap: var(--space-12); }
.db-weekly-bar, .db-spans-head { display: flex; align-items: center; gap: var(--space-4); }
.db-weekly-span, .db-spans-span { margin-right: auto; font-weight: 500; font-variant-numeric: tabular-nums; }
.db-weekly-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--space-4); }
.db-weekly-days[data-dir="1"] > .db-weekly-day { animation: db-cal-next var(--dur-240) var(--ease) backwards; animation-delay: calc(var(--i, 0) * 28ms); }
.db-weekly-days[data-dir="-1"] > .db-weekly-day { animation: db-cal-prev var(--dur-240) var(--ease) backwards; animation-delay: calc((6 - var(--i, 0)) * 28ms); }
.db-weekly-days[data-rise] .db-weekly-item { animation: db-rise var(--dur-420) var(--ease) backwards; animation-delay: calc(var(--i, 0) * 35ms); }
.db-weekly-day { min-width: 0; min-height: 320px; padding: var(--space-6); border-radius: var(--radius-12); background-color: var(--g-hover); display: flex; flex-direction: column; gap: var(--space-6); }
.db .db-weekly-day[aria-current="date"] { background-color: var(--g3); box-shadow: var(--depth-2); }
.db-weekly-head { min-height: var(--h-36); padding: 0 var(--space-4) var(--space-4) var(--space-6); display: flex; align-items: center; justify-content: space-between; gap: var(--space-8); font-size: var(--fs-label); color: var(--ink3); }
.db-weekly-n { min-width: 28px; height: 28px; padding-inline: var(--space-6); border-radius: var(--radius-pill); display: grid; place-items: center; font-size: var(--fs-body); font-weight: 500; font-variant-numeric: tabular-nums; color: var(--ink2); }
.db-weekly-day[aria-current="date"] .db-weekly-head { color: var(--ink); font-weight: 600; }
.db-weekly-day[aria-current="date"] .db-weekly-n { background: var(--live); color: var(--on-signal); font-weight: 600; }
.db-weekly-item { min-width: 0; padding: var(--space-8) var(--space-10); border: 0; border-radius: var(--radius-6); background: color-mix(in srgb, var(--k, var(--ink3)) 22%, transparent); color: var(--ink); font: inherit; line-height: 1.3; text-align: left; cursor: pointer; display: grid; grid-template-columns: 6px minmax(0, 1fr); column-gap: var(--space-6); row-gap: var(--space-4); align-items: start; transition: background var(--dur-140) var(--ease), transform var(--dur-140) var(--ease); }
.db-weekly-item::before { content: ""; width: 6px; height: 6px; margin-top: 5.5px; align-self: start; border-radius: 50%; background: var(--k, var(--ink3)); }
.db-weekly-item:hover { background: color-mix(in srgb, var(--k, var(--ink3)) 36%, transparent); transform: translateY(-1px); }
.db-weekly-item:active { transform: scale(0.98); }
.db-weekly-time { font-size: var(--fs-label); color: var(--ink2); font-variant-numeric: tabular-nums; }
.db-weekly-name { font-size: var(--fs-label); font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.db-weekly-time + .db-weekly-name { grid-column: 1 / -1; }
/* The entries a day has no room for fold away under a button to click that says how many they are. The fold
   keeps a little room on every side, so an entry's ring and its rise are never cut. */
.db-weekly-fold { margin: -3px; }
.db-weekly-fold > div { padding: 3px; display: flex; flex-direction: column; gap: var(--space-6); }
.db-weekly-day > .db-more { margin: 2px 0 0 var(--space-6); }
.db-weekly-wait { height: 58px; }
.db-weekly-wait:nth-child(odd) { height: 78px; }

/* Shares bar: one bar in parts of a whole, each part can be clicked. A part's width is its share; its name
   and its count stand over it. A part too narrow for them keeps a width that can be pressed, and its
   name and count stand in a line under the bar, lit together with it. The part under the pointer
   rises and the parts beside it rise a little; the chosen part stays risen while the rest draw back. */
.db-shares { min-width: 0; display: flex; flex-direction: column; gap: var(--space-8); }
.db-shares-bar { position: relative; display: flex; align-items: flex-end; gap: 3px; }
/* A floor: a thin mark across the bar at a value the whole must reach, its words under it, in the
   colour of what is written on the ground. A line of the ground on each side keeps it plain over a
   fill and over the empty run alike. */
.db-shares-bar:has(> .db-shares-floor:not([data-side="none"])) { margin-bottom: var(--space-20); }
.db-shares-short { flex: var(--v, 0) 1 0; height: 10px; border-radius: var(--radius-pill); background: var(--g-press); }
.db-shares-floor { position: absolute; left: var(--x, 100%); bottom: -4px; width: 2px; height: 24px; margin-left: -1px; border-radius: 1px; background: var(--ink); box-shadow: 0 0 0 1.5px var(--ground, var(--g1)); pointer-events: none; transition: left var(--dur-240) var(--ease); }
.db-shares-floor > span { position: absolute; top: calc(100% + 3px); left: 50%; transform: translateX(-50%); font-size: var(--fs-label); font-weight: 500; line-height: 1.2; white-space: nowrap; color: var(--ink); }
.db-shares-floor[data-side="start"] > span { left: 0; transform: none; }
.db-shares-floor[data-side="end"] > span { left: auto; right: 0; transform: none; }
.db-shares-floor[data-side="none"] { display: none; }
.db-shares-bar:empty { height: 10px; border-radius: var(--radius-pill); background: var(--g-press); }
.db-share, .db-shares-key { --c: var(--k, color-mix(in srgb, var(--live) calc(38% + var(--at, 1) * 62%), var(--g2))); }
.db-share { position: relative; flex: var(--v, 1) 1 0; min-width: var(--space-20); padding: 0; border: 0; border-radius: var(--radius-8); background: none; color: var(--ink3); font: inherit; text-align: left; cursor: pointer; display: flex; flex-direction: column; align-items: flex-start; transition: flex-grow var(--dur-420) var(--ease), color var(--dur-140) var(--ease); }
.db-share:disabled { opacity: var(--op-disabled); pointer-events: none; }
.db-share-name { font-size: var(--fs-label); white-space: nowrap; }
.db-share-n { margin-bottom: var(--space-4); font-size: var(--fs-lead); font-weight: 500; line-height: 1.25; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink2); transition: color var(--dur-140) var(--ease); }
.db-share:is(:hover, :focus-visible, [aria-pressed="true"]), .db-share:is(:hover, :focus-visible, [aria-pressed="true"]) .db-share-n { color: var(--ink); }
.db-share[aria-pressed="true"] .db-share-name { font-weight: 500; }
.db-share[data-tight] > :is(.db-share-name, .db-share-n) { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip-path: inset(50%); }
.db-share-fill { align-self: stretch; height: 18px; display: flex; align-items: flex-end; }
.db-share-fill::before { content: ""; flex: 1; height: calc(10px + var(--near, 0) * 6px); border-radius: var(--radius-pill); background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 72%, var(--light-core))); box-shadow: 0 0 16px -3px color-mix(in srgb, var(--c) var(--glow), transparent); transition: height var(--dur-240) var(--ease-settle), opacity var(--dur-240) var(--ease), box-shadow var(--dur-240) var(--ease); }
.db-share[aria-pressed="true"] .db-share-fill::before { height: 16px; box-shadow: 0 0 20px -2px color-mix(in srgb, var(--c) var(--glow), transparent), 0 5px 14px -5px color-mix(in srgb, var(--c) var(--glow), transparent); }
.db-shares-bar:has([aria-pressed="true"]) .db-share:not([aria-pressed="true"]) .db-share-fill::before { opacity: 0.38; box-shadow: none; }
.db-shares-bar:has([aria-pressed="true"]) .db-share:not([aria-pressed="true"]):is(:hover, :focus-visible) .db-share-fill::before { opacity: 0.8; }
.db-shares-keys { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-4) var(--space-16); }
.db-shares-keys[data-side="start"] { justify-content: flex-start; }
.db-shares-keys:empty { display: none; }
.db-shares-key { display: inline-flex; align-items: baseline; gap: var(--space-6); font-size: var(--fs-label); color: var(--ink3); cursor: pointer; transition: color var(--dur-140) var(--ease); }
.db-shares-key::before { content: ""; flex: none; align-self: center; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.db-shares-key > b { font-weight: 500; font-variant-numeric: tabular-nums; color: var(--ink2); }
.db-shares-key[data-on], .db-shares-key[data-on] > b { color: var(--ink); }

/* Lanes over time: a lane for each thing, down the side, across a scale of weeks. Each dated event
   is a bar of its kind's colour over the days it takes; an event of one day is a short bar. The
   piece scrolls inside itself both ways: the scale stays at the top, each lane's name at the left.
   A line at every week's first day and one line for today run down all the lanes. */
.db-spans { min-width: 0; display: flex; flex-direction: column; gap: var(--space-12); }
.db-spans-box { --ground: var(--g1); --name-w: 216px; --day-w: 22px; position: relative; max-height: 420px; overflow: auto; overscroll-behavior: contain; border-radius: var(--radius-8); }
.db-spans-grid { position: relative; min-width: calc(var(--name-w) + var(--days, 42) * var(--day-w)); display: flex; flex-direction: column; }
.db-spans-scale, .db-spans-lane { display: grid; grid-template-columns: var(--name-w) repeat(var(--days, 42), minmax(0, 1fr)); }
.db-spans-scale { position: sticky; top: 0; z-index: 3; height: var(--h-32); background: var(--ground); }
.db-spans-scale > *, .db-spans-scale::before { grid-row: 1; }
.db-spans-scale::before, .db-spans-name { position: sticky; left: 0; z-index: 2; background: var(--ground); }
.db-spans-scale::before { content: ""; }
.db-spans-week { grid-column: calc(var(--c) + 2) / span 7; min-width: 0; padding-left: var(--space-8); display: flex; align-items: center; font-size: var(--fs-label); font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink3); box-shadow: inset 1px 0 0 var(--hair2); }
.db-spans-lane { position: relative; min-height: var(--row); padding-block: var(--space-8); row-gap: var(--space-4); align-items: center; box-shadow: inset 0 1px 0 var(--hair); }
.db-spans-lane::before { content: ""; grid-column: 2 / -1; grid-row: 1 / span var(--rows, 1); align-self: stretch; margin-block: calc(var(--space-8) * -1); background: linear-gradient(90deg, var(--hair) 1px, transparent 1px) 0 0 / calc(100% / var(--weeks, 6)) 100%; pointer-events: none; }
.db-spans-name { grid-column: 1; grid-row: 1 / span var(--rows, 1); align-self: stretch; margin-block: calc(var(--space-8) * -1); padding: var(--space-8) var(--space-16) var(--space-8) 0; display: flex; flex-direction: column; justify-content: center; font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; box-shadow: inset 0 1px 0 var(--hair); }
.db-spans-name > small { font-size: var(--fs-label); font-weight: 400; color: var(--ink3); }
.db-spans-bar { grid-column: calc(var(--c) + 2) / span var(--n, 1); grid-row: var(--r, 1); z-index: 1; min-width: 0; height: 16px; margin-inline: 2px; padding: 0; border: 0; border-radius: 5px; background: var(--k, var(--ink3)); font-size: 0; cursor: pointer; transform: scaleY(calc(1 + var(--near, 0) * 0.34)); transition: transform var(--dur-240) var(--ease), box-shadow var(--dur-240) var(--ease); }
/* The bar under the pointer brightens at once, never over time: WebKit can lose the page while a filter runs over time on a bar that is growing */
.db-spans-bar:hover { filter: brightness(1.12); box-shadow: 0 0 16px -3px color-mix(in srgb, var(--k, var(--ink3)) var(--glow), transparent); }
/* A bar that runs past either end of the scale is cut square at that end */
.db-spans-bar[data-from-before] { margin-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.db-spans-bar[data-on-after] { margin-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.db-spans-today { position: absolute; z-index: 1; top: 0; bottom: 0; left: calc(var(--name-w) + (100% - var(--name-w)) * var(--at)); width: 2px; margin-left: -1px; border-radius: 1px; background: var(--live); pointer-events: none; }
.db-spans-now { grid-column: calc(var(--c) + 2); align-self: end; justify-self: center; width: 8px; height: 8px; margin-bottom: -4px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 3px var(--live-wash); }
.db-spans-box[data-dir="1"] :is(.db-spans-week, .db-spans-bar, .db-spans-today, .db-spans-now) { animation: db-cal-next var(--dur-240) var(--ease); }
.db-spans-box[data-dir="-1"] :is(.db-spans-week, .db-spans-bar, .db-spans-today, .db-spans-now) { animation: db-cal-prev var(--dur-240) var(--ease); }

/* Year strip: the heat strip in one row, a cell for each week of a year, the names of the months
   under it where each starts. It fills the width it is given: a block on a page, or a table's row,
   where the months step aside. The cell nearest the pointer grows; this week carries a ring. */
.db-heat-year { container-type: inline-size; min-width: 0; display: flex; flex-direction: column; gap: var(--space-6); }
.db-heat-year > .db-heat { grid-template-rows: 28px; grid-auto-columns: minmax(0, 1fr); gap: 2px; }
.db-heat-week { min-width: 0; padding: 0; border: 0; border-radius: var(--radius-3); background: none; cursor: pointer; display: flex; align-items: flex-end; }
.db-heat-week > i { flex: 1; width: auto; min-width: 0; height: 18px; transform-origin: 50% 100%; transform: scaleY(calc(1 + var(--near, 0) * 0.55)); transition: transform var(--dur-240) var(--ease); }
.db-heat-week[aria-current="true"] > i { box-shadow: 0 0 0 1.5px var(--ground, var(--g1)), 0 0 0 3px var(--ink); }
.db .db-heat-week:focus-visible { box-shadow: none; }
.db .db-heat-week:focus-visible > i { box-shadow: var(--focus); }
.db-heat-months { position: relative; height: 18px; font-size: var(--fs-label); color: var(--ink3); }
.db-heat-months > span { position: absolute; top: 0; left: calc(100% * var(--at)); white-space: nowrap; }
@container (max-width: 420px) {
  .db-heat-year > .db-heat { grid-template-rows: 22px; gap: 1px; }
  .db-heat-week > i { height: 14px; border-radius: 1.5px; }
  .db-heat-months { display: none; }
}

/* Well of pages: a sunk place where a document's pages scroll, one under another. Its head stays
   put and says which page is in view. */
.db-well { --ground: var(--g0); min-width: 0; border-radius: var(--radius-12); background: var(--ground); display: flex; flex-direction: column; }
.db-well-head { position: relative; z-index: 1; min-height: var(--row); padding: 0 var(--space-8) 0 var(--space-16); display: flex; align-items: center; gap: var(--space-4); }
.db-well-head::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: var(--space-16); background: linear-gradient(var(--ground), transparent); opacity: 0; transition: opacity var(--dur-140) var(--ease); pointer-events: none; }
.db-well[data-scrolled] .db-well-head::after { opacity: 1; }
.db-well-name { margin-right: auto; min-width: 0; font-weight: 500; overflow-wrap: anywhere; }
.db-well-at { margin-right: var(--space-8); font-size: var(--fs-label); font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink2); }
.db-well-pages { position: relative; max-height: 540px; overflow: auto; overscroll-behavior: contain; padding: var(--space-4) var(--space-16) var(--space-16); border-radius: 0 0 var(--radius-12) var(--radius-12); }
/* Page mark: a small leaf of paper with a number on it, for how many pages a thing has. On a tile it stands where the tile's mark does. */
.db-pagemark { position: relative; flex: none; min-width: 24px; height: 30px; padding: var(--space-6) var(--space-4) 0; border-radius: var(--radius-3); background: var(--page); color: var(--on-page); box-shadow: var(--depth-1); display: inline-grid; place-items: center; font-size: var(--fs-label); font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.db-pagemark::after { content: ""; position: absolute; top: 0; right: 0; width: 8px; height: 8px; border-radius: 0 var(--radius-3) 0 2px; background: linear-gradient(225deg, var(--ground, var(--g1)) 50%, color-mix(in srgb, var(--on-page) 26%, var(--page)) 50%); }
.db-tile > .db-pagemark { align-self: flex-end; margin-top: auto; }

/* Settings row: the mark of a setting, its name, and a chevron. The mark and the name are a
   carried cluster, so a click carries them to the head of the setting's page, and Back carries
   them home. */
.db-settings { position: relative; min-width: 0; }
.db-settings-list { display: flex; flex-direction: column; }
.db-setting { position: relative; min-height: var(--space-56); padding: var(--space-8) var(--space-12); margin-inline: calc(var(--space-12) * -1); border: 0; border-radius: var(--radius-8); background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; display: flex; align-items: center; gap: var(--space-12); transition: background var(--dur-140) var(--ease); }
.db-setting + .db-setting::before { content: ""; position: absolute; inset: 0 var(--space-12) auto; height: 1px; background: var(--hair); }
.db-setting:hover { background: var(--g-hover); }
.db-setting:hover::before, .db-setting:hover + .db-setting::before { opacity: 0; }
.db-setting:active { background: var(--g-press); }
.db-setting > .db-carry { --mark: 32px; --carry-gap: var(--space-12); flex: 1; flex-wrap: nowrap; }
.db-setting .db-carry-name { font-family: inherit; font-size: var(--fs-body); font-weight: 500; }
.db-setting > .db-mark { color: var(--ink3); transition: transform var(--dur-240) var(--ease-settle), color var(--dur-140) var(--ease); }
.db-setting:hover > .db-mark { color: var(--ink); transform: translateX(3px); }
.db-settings-page { display: flex; flex-direction: column; gap: var(--space-20); }
.db-settings-head { display: flex; align-items: center; gap: var(--space-12); margin-left: calc(var(--space-8) * -1); }
.db-settings-head > .db-carry { flex: 1; }

@media (prefers-reduced-motion: reduce) {
  .db *, .db *::before, .db *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
