/* ---------- objects at rest ---------- */
.obj {
  position: absolute; box-sizing: border-box;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r);
  box-shadow: var(--shadow-rest);
  outline: 1.25px solid transparent; outline-offset: 9px;      /* the selection ring closes in from here (.sel) */
  transition: border-color 120ms ease-out, box-shadow 120ms ease-out, outline-color 160ms ease-out, outline-offset 220ms cubic-bezier(.2, .8, .2, 1);
}
.obj > * { transition: opacity 160ms ease-out; }
/* A finger on an object is the press machine's (section 12), which carries it: an object that scrolls inside (a note,
   a board's body) would otherwise take the touch for itself and the page would cancel it. Text being typed in keeps
   its own touches, to scroll and select. */
.obj { touch-action: none; }
.obj .ed:focus { touch-action: pan-y; }
.obj.text, .obj.todo, .obj.table { overflow: hidden auto; scrollbar-width: thin; }    /* taller than the screen: scrolls inside (keepInView) */
/* In Safari's engine (html.wk, index.html) not as the browser's own scroller: that is a layer of its own, and one
   anywhere in the canvas makes WebKit draw the whole canvas as a layer at 1:1 and stretch it when zoomed in, blurred
   for as long as it is there (Jarred, 2026-10-31: "一直糊", in the Mac app and Safari). There the wheel scrolls it
   (camera.js, scrollsInside), and a finger while it is typed in on a phone or a tablet. So does anything else that
   is a layer of its own in WebKit: a backdrop (style.css, .otag; cards.css, .fc-play) or an animated opacity
   (cards.css, .pic-try and .fc-wait). */
html.wk .obj:is(.text, .todo, .table) { overflow-y: hidden; }
html.wk.pocket .obj:is(.text, .todo, .table):focus-within { overflow-y: auto; }
.obj:focus-within { border-color: var(--ink-3); box-shadow: var(--shadow-rest), 0 0 0 3px var(--halo); }
.obj.settle { transition: background-color 200ms cubic-bezier(.2, 0, 0, 1), border-color 360ms ease-out 60ms, box-shadow 200ms ease-out; }
.ed { outline: none; cursor: text; }
.ed[data-ph]:empty::before { content: attr(data-ph); color: var(--ink-3); pointer-events: none; }

.obj.text { display: flex; flex-direction: column; }
.tx { flex: 1; padding: 10px 14px; font-size: 18px; line-height: 28px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* A header has no box to see, and no border, so the title sits exactly where the ghost showed it. */
.obj.header { translate: 0 -100%; display: flex; align-items: flex-end; background: transparent; border-width: 0; box-shadow: none; }
.obj.header::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--rule-2); transition: background-color 120ms ease-out; }
.obj.header::before { content: ""; position: absolute; left: -2px; bottom: -2px; width: 5px; height: 5px; background: var(--rule-2); transition: background-color 120ms ease-out; }
.obj.header:focus-within::before { background: var(--ink-3); }
.obj.header:focus-within { border-color: transparent; box-shadow: none; }
.obj.header:focus-within::after { background: var(--ink-3); }
.hd {
  width: 100%; box-sizing: border-box; padding: 0 2px 8px; color: var(--ink);
  font-family: var(--f-display); font-weight: 500; line-height: 1.1; --ls: -.015em; font-optical-sizing: auto;
  white-space: pre-wrap; overflow-wrap: anywhere; text-wrap: balance; scrollbar-width: thin;
}

.obj.board { overflow: hidden; }
.bhead { display: flex; align-items: center; gap: 9px; height: 40px; box-sizing: border-box; padding: 0 14px; border-bottom: 1px solid var(--rule); }
/* The board glyph is a button that opens the board; on hover or keyboard focus it turns into an expand mark.
   The 26px hit area sits on the original 14px glyph via negative margins, so the header keeps its layout
   and its hover fill and (inset) focus ring stay 3px clear of the title. */
.bicon {
  position: relative; flex: none; display: grid; place-items: center; width: 26px; height: 26px; margin: 0 -6px; padding: 0;
  border: 0; border-radius: 3px; background: transparent; color: var(--ink-2); cursor: pointer;
  transition: background-color 120ms ease-out, color 120ms ease-out;
}
.bicon i, .bicon svg { grid-area: 1 / 1; width: 14px; height: 14px; transition: opacity 120ms ease-out; }
.bicon i {
  border-radius: 2px; box-shadow: inset 0 0 0 1.5px currentColor;
  background:
    linear-gradient(currentColor, currentColor) 3.5px 3.5px / 3px 3px no-repeat,
    linear-gradient(currentColor, currentColor) 7.5px 3.5px / 3px 3px no-repeat,
    linear-gradient(currentColor, currentColor) 3.5px 7.5px / 3px 3px no-repeat;
}
.bicon svg { opacity: 0; }
@media (hover: hover) {   /* .hov: the header copy over a zoom keeps the look the icon was clicked with */
  .bicon:hover, .bicon.hov { background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink); }
  .bicon:hover i, .bicon.hov i { opacity: 0; }
  .bicon:hover svg, .bicon.hov svg { opacity: 1; }
}
.bicon:active { background: color-mix(in srgb, var(--ink) 9%, transparent); }
.bicon:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; color: var(--ink); }
.bicon:focus-visible i { opacity: 0; }
.bicon:focus-visible svg { opacity: 1; }
.bt { flex: 1; min-width: 0; font: 500 17px/22px var(--f-display); letter-spacing: -.008em; font-optical-sizing: auto; white-space: nowrap; overflow: hidden; }
.bt:not(:focus) { text-overflow: ellipsis; }
.binner {
  position: absolute; top: 40px; left: 0; right: 0; bottom: 0; overflow: hidden;
  background-color: var(--canvas);
  background-image: radial-gradient(var(--dot-ink) var(--dot-r), transparent calc(var(--dot-r) + .3px));
  background-size: 24px 24px; background-position: 12px 12px; background-attachment: fixed;
  box-shadow: var(--sunk);          /* the board's body is a well its contents sit in */
}
/* The miniature: the board's own objects, live but inert, scaled to fit the card body (set from script).
   Nested miniatures stop drawing after four levels. */
.mini { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; }
.mini .mini .mini .mini .mini { display: none; }
.mini .binner { background-image: none; }               /* scaled-down dots alias into noise; nested bodies read as plain panels */
/* At miniature scale a card's 1px border vanishes, so a panel the colour of the board's body would come loose from its card:
   a nested board's body and a file card's window are tinted a step off the canvas. */
.mini .binner, .mini .fc-win { background-color: color-mix(in srgb, var(--ink) 4%, var(--canvas)); }

/* A level above the open one, put in the page for a moment so what goes into it can be measured (section 17b): never drawn. */
.lay { position: fixed; left: 0; top: 0; width: 0; height: 0; overflow: hidden; visibility: hidden; pointer-events: none; }

/* Entering or leaving a board: the board's canvas grows from its card body to full screen, or shrinks back into it,
   its edge in the depth colour (section 25): the one moment you see a level change. All of it moves by transforms, on
   the compositor (zoomRun): the layer is laid out over the whole screen and scaled to its rect; its dots (.zdots) and
   rulers (#zax, section 19i) are canvases scaled back to the screen's px, and its edge is four strips and, where its
   card's corners are round, a piece at each corner that only slides, its arc a canvas of every radius on the way (#zring). */
#zoom {
  position: fixed; left: 0; top: 0; z-index: 5; box-sizing: border-box; overflow: hidden; pointer-events: none;
  transform-origin: 0 0; background-color: var(--canvas);
}
#zoom .zmv, #zoom .zin, #zoom .zdots { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
#zring { position: fixed; left: 0; top: 0; z-index: 5; pointer-events: none; }
#zring > i { position: fixed; left: 0; top: 0; transform-origin: 0 0; background: var(--z-soft); }
#zring > i.ln { background: var(--z); }
#zring > b { position: fixed; left: 0; top: 0; overflow: hidden; transform-origin: 0 0; }
#zring > b > canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
/* Meanwhile a copy of the card's header rides on the layer's top edge, as wide as it (boards.js zoomRun): the card's
   head as it would be if the whole card grew to the screen, out over the top as the board opens, back down as it
   closes. Above the layer, so its moving edge never cuts through the title. */
#zhead {
  position: fixed; left: 0; top: 0; z-index: 6; box-sizing: border-box; overflow: hidden; pointer-events: none; transform-origin: 0 0;
  background: var(--surface); border: 1px solid var(--rule); border-bottom: 0; border-radius: var(--r) var(--r) 0 0;
}

.tgrid { display: grid; font-size: 15px; line-height: 22px; font-variant-numeric: tabular-nums; }
.tc {
  min-width: 0; padding: 8px 12px;   /* over and under a 22px line, and its rule: TB.ROW */
  border-bottom: 1px solid var(--rule); border-right: 1px solid color-mix(in srgb, var(--rule) var(--rule-v), transparent);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.tc.ce { border-right: 0; }
.tc.re { border-bottom: 0; }
.obj.table .tc.th {
  font-family: var(--f-mono); font-size: .77em; font-weight: 500; --ls: .09em; text-transform: uppercase; color: var(--ink-2);
  background: transparent; border-bottom-color: var(--rule-2);
}
.tc:focus { background: color-mix(in srgb, var(--ink) 3%, var(--surface)); box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.obj.table .tc.th:focus { background: color-mix(in srgb, var(--ink) 4%, var(--surface)); }

.obj.todo { padding-bottom: 4px; }
.tdt { padding: 12px 14px 8px; font: 500 19px/25px var(--f-display); --ls: -.01em; font-optical-sizing: auto; }   /* TD.TITLE */
/* Its tally (todoTally, section 7): how many of its tasks are done, in figures at the title's end, and a measured line
   under the title, a stretch for each task, those done drawn in. A list with no tasks written yet has neither. */
.obj.todo[data-tally] > .tdt {
  --g: 3px;             /* between two tasks' stretches */
  padding-right: 58px; padding-bottom: 15px;
  background:
    repeating-linear-gradient(90deg, var(--ink-2) 0 calc(100% / max(var(--td-d, 1), 1) - var(--g)), transparent 0 calc(100% / max(var(--td-d, 1), 1)))
      left 14px bottom 6px / calc((100% - 28px + var(--g)) * var(--td-d, 0) / var(--td-n, 1)) 2px no-repeat,
    repeating-linear-gradient(90deg, var(--rule-2) 0 calc(100% / var(--td-n, 1) - var(--g)), transparent 0 calc(100% / var(--td-n, 1)))
      left 14px bottom 6.5px / calc(100% - 28px + var(--g)) 1px no-repeat;
}
.obj.todo[data-tally]::after {
  content: attr(data-tally); position: absolute; top: 12px; right: 14px; pointer-events: none;
  font: 500 11px/25px var(--f-mono); letter-spacing: .02em; color: var(--ink-q); font-variant-numeric: tabular-nums;
}
.obj.todo[data-all]::after { color: var(--ink); }
.ti { position: relative; display: flex; align-items: flex-start; gap: 10px; min-height: var(--ti-h, 36px); padding: 0 14px; box-sizing: border-box; }   /* TD.ROW; a resize stretches the rows */
.box {
  flex: none; width: 15px; height: 15px; margin-top: 10.5px; padding: 0; box-sizing: border-box;
  display: grid; place-items: center; border-radius: 2.5px; border: 1.5px solid var(--ink-3);
  background: transparent; color: var(--surface); cursor: pointer;
  transition: background-color 120ms ease-out, border-color 120ms ease-out, opacity 160ms ease-out;
}
.box svg { width: 11px; height: 11px; }
.box path { stroke-dasharray: 14; stroke-dashoffset: 14; transition: stroke-dashoffset 120ms ease-in; }
.ti.done .box { background: var(--ink); border-color: var(--ink); }
.ti.done .box path { stroke-dashoffset: 0; transition: stroke-dashoffset 240ms cubic-bezier(.3, 0, .2, 1) 50ms; }
@media (prefers-reduced-motion: reduce) { .box path, .ti.done .box path { transition: none; } }
.tit { flex: 1; min-width: 0; padding: 6px 0; font-size: 16px; line-height: 24px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ti.done .tit { color: var(--ink-3); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ink-3) 70%, transparent); text-decoration-thickness: 1px; }
.ti:has(.tit:empty) ~ .ti .tit:empty::before, .ti.done .tit:empty::before { content: none; }
/* A subtask (data-indent, section 6): a step in for each task it stands under, a step being a box and the gap after it
   (TI.STEP), so its box is under the text of the task it belongs to. */
.ti[data-indent="1"] { padding-left: 39px; }
.ti[data-indent="2"] { padding-left: 64px; }
.ti[data-indent="3"] { padding-left: 89px; }
/* An empty task being typed in says what its keys make (data-hint, section 7): Enter a task, Shift+Enter a subtask.
   In the tally's quiet figures, on the task's own line; cut short, never wrapped onto another. Not on a touch screen
   alone: its keyboard gives no Shift+Enter. */
@media (hover: hover), (pointer: fine) {
  .obj.todo > .tis > .ti > .tit[data-hint]:empty:focus::before {
    content: attr(data-hint); display: inline-block; max-width: 100%; overflow: hidden; vertical-align: top;
    white-space: nowrap; text-overflow: ellipsis; font-family: var(--f-mono); font-size: 11px; font-weight: 500; letter-spacing: .02em;
    color: var(--ink-q);
  }
}
/* A row with nothing written in it yet is a place for a task, not a task: its box waits, faint, until it is typed in. */
.ti:not(.done):has(> .tit:empty:not(:focus)) > .box:not(:focus-visible) { opacity: .4; }   /* a key's focus ring is never faint */
/* A task's grip (section 12b): six dots in the margin at its right end, level with its box, that carry the task to
   another place in its list or out into a list of its own. It shows on the task under the pointer, and quieter on
   every task of a selected list; with a finger, on every task of a list selected or typed in. It takes no room from
   the task: no word wraps sooner for it. */
.ti::after {
  content: ""; position: absolute; top: 13px; right: 4px; width: 2px; height: 2px; border-radius: 50%;
  background: currentColor; box-shadow: 0 4px currentColor, 0 8px currentColor, -4px 0 currentColor, -4px 4px currentColor, -4px 8px currentColor;
  color: var(--ink-3); opacity: 0; transition: opacity 120ms ease-out;
}
#objs .obj.todo.sel > .tis > .ti::after { opacity: .55; }
@media (hover: hover) { #objs .obj.todo > .tis > .ti:hover::after { opacity: 1; } }
@media (hover: none) { #objs .obj.todo:is(.sel, :focus-within) > .tis > .ti::after { opacity: 1; } }
#objs .us .ti::after, .ti.tk-gap { visibility: hidden; }
/* The task in the hand: a sheet lifted as a carried object is (.paper at full lift, selection.css), the task alone
   while it is over a list (.in), the list it will be once it is out of them all; let go, it settles (.down). */
#ghosts > .obj.tk-lift {
  box-shadow: var(--shadow-rest), 0 0 0 1px var(--rim), 0 18px 34px -6px var(--drop-1), 0 4px 10px 0 var(--drop-2);
  transition: box-shadow 160ms ease-out; animation: tk-lift 140ms cubic-bezier(.2, .8, .2, 1);
}
#ghosts > .obj.tk-lift.down { box-shadow: var(--shadow-rest); }
@keyframes tk-lift { from { box-shadow: var(--shadow-rest), 0 0 0 0 var(--rim), 0 0 0 0 var(--drop-1), 0 0 0 0 var(--drop-2); } }
.obj.tk-lift.in { padding-bottom: 0; }
.obj.tk-lift.in > .tdt, .obj.tk-lift.in::after { display: none; }
.obj.tk-lift .ti::after { opacity: 1; color: var(--ink-2); }
/* Where a list carried over another goes into it (section 12b): a line between two of its tasks, from the middle of
   its boxes to the end of its text, drawn on the list's own paper (--tk-bg), as a column shows where a card goes
   (columns.css .cline), and as that one over the sheet in the hand, however the camera stands. */
.tk-line {
  position: absolute; z-index: 2; height: 2px; margin-top: -1px; border-radius: 1px; background: var(--ink); box-shadow: 0 0 0 2px var(--tk-bg);
  pointer-events: none; transition: top 90ms ease-out;
}
.tk-line::before {
  content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; box-sizing: border-box;
  border: 2px solid var(--ink); border-radius: 50%; background: var(--tk-bg); box-shadow: 0 0 0 2px var(--tk-bg);
}

