/* The stitch diaries (templates/diary.html, diary/*.js), on the gallery's page (gallery.css): the
   shelf of voxel books, and the cover editor — the book up top, a flat board of cloth under it, a
   tray of tools and the one row of what they take. */

/* ---------- the shelf: books standing on a dotted ground, three across (two on a phone) ---------- */
.d-shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 14px; margin: 18px 0 40px; }
.d-book { position: relative; display: flex; flex-direction: column; align-items: center; padding-top: 10px; color: var(--ink); text-decoration: none; text-align: center; }
.d-stand { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; width: 100%; height: 178px; border-bottom: 2px dotted #d8c9ae; }
.d-stand canvas { position: relative; margin-bottom: -8px; }
.d-name { margin-top: 12px; font: var(--pixel); text-shadow: 2px 2px 0 #d6cfc2; -webkit-font-smoothing: none; word-break: keep-all; }
.d-by { margin-top: 4px; color: var(--ink-3); font-size: 12px; }
.d-mine { margin-bottom: 10px; padding: calc(2px - var(--text-lift)) 9px calc(2px + var(--text-lift)); border-radius: 999px; background: var(--ink); color: var(--paper); font-size: 11px; line-height: 16px; white-space: nowrap; }
/* over a book: "my diary", and comments new to the viewer (a red count beside it, alone at the same height on another's) */
.d-over { display: flex; align-items: center; gap: 4px; height: 20px; margin-bottom: 10px; }
.d-over .d-mine { margin-bottom: 0; }
.d-badge { min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 999px; background: #c4452b; color: #fff;
           padding-bottom: calc(2 * var(--text-lift)); font: 600 11px/calc(18px - 2 * var(--text-lift)) var(--sans); text-align: center; font-variant-numeric: tabular-nums; }
a.d-book:hover .d-name { text-decoration: underline; text-underline-offset: 5px; }
a.d-book:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
/* a book with whose it is under it: the handle, the way to their profile (beside the book's link, not in it) */
.d-tile { display: flex; flex-direction: column; }
.d-tile > .d-by { align-self: center; }
a.d-handle { color: var(--ink-3); text-decoration: none; }
a.d-handle:hover { text-decoration: underline; text-underline-offset: 3px; }
a.d-handle:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 2px; }
/* the book not made yet: grey, a dashed ground; it lifts a little when pointed at */
.d-unmade .d-stand { border-bottom-style: dashed; border-bottom-color: #cfc6b4; }
.d-unmade .diary-sprite { filter: none; opacity: .85; transition: transform .15s, opacity .15s; }
.d-unmade:hover .diary-sprite, .d-unmade:focus-visible .diary-sprite { transform: translateY(-4px); opacity: 1; }
.d-unmade .d-name { color: var(--ink-3); text-shadow: none; }
.diary-sprite { display: block; filter: drop-shadow(0 6px 8px rgba(80, 50, 20, .14)); }

/* ---------- the editor ---------- */
.d-stage { position: relative; display: flex; align-items: flex-end; justify-content: center; height: 330px; }
.d-stage canvas { position: relative; }
.d-title { display: block; width: min(320px, 80%); margin: 10px auto 18px; padding: 4px 0; border: 0; border-bottom: 1.5px dashed transparent;
  background: none; color: var(--ink); font: var(--pixel); text-align: center; text-shadow: 2px 2px 0 #d6cfc2; -webkit-font-smoothing: none; }
.d-title:hover, .d-title:focus { outline: none; border-bottom-color: #c9b98f; }

/* the board: the spine and the front, flat cloth with their holes */
.d-board { display: flex; justify-content: center; align-items: flex-start; gap: 12px; }
.d-panel { position: relative; }
.d-panel small { display: block; margin-top: 6px; color: var(--ink-3); font: 11px var(--mono); letter-spacing: .2em; text-align: center; }
.d-reroll { align-self: flex-end; display: grid; justify-items: center; gap: 2px; width: 44px; margin: 0 -56px 16px 0; padding: 5px 0 4px; border: 0;
  border-radius: 10px; background: none; color: var(--ink-3); font: 11px/1 var(--sans); cursor: pointer; }   /* a wand beside the front, low; its room outside the board's middle */
.d-reroll canvas { width: 28px; height: 28px; image-rendering: pixelated; transition: transform .15s; }
.d-reroll:hover { background: #ebe4d6; color: var(--ink); }
.d-reroll:hover canvas { transform: translateY(-2px); }
.d-reroll:active canvas { transform: scale(.88); }
.d-cloth { display: block; border-radius: 4px; touch-action: none; cursor: crosshair; }

/* the tools: the segmented control (.d-seg) with a pixel picture beside each name, undoing past a hairline; then the rows of what they take */
.d-seg.d-tray { width: fit-content; margin: 20px auto 6px; padding: 3px; }
.d-seg.d-tray button { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 15px 0 10px; font-size: 13px; }
.d-seg.d-tray .d-undo { padding: 0 9px; }
.d-tray canvas { width: 32px; height: 32px; image-rendering: pixelated; }
.d-tray i { width: 1px; height: 20px; margin: 0 2px; background: #d3cab8; }
.d-drawer { display: flex; align-items: center; justify-content: safe center; gap: 6px; min-height: 68px; padding: 10px 2px 4px; overflow-x: auto; scrollbar-width: none; }
.d-drawer::-webkit-scrollbar { display: none; }
.d-spool { position: relative; flex: none; padding: 4px 3px 6px; border: 0; border-radius: 8px; background: none; cursor: pointer; }
.d-spool canvas { display: block; width: 22px; height: 33px; image-rendering: pixelated; }
.d-spool[aria-pressed="true"] { background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--ink); }
.d-spool-add { margin-right: 4px; }
.d-drop canvas { animation: d-drop .32s cubic-bezier(.3, 1.6, .5, 1); }   /* a spool just put out drops in */
@keyframes d-drop { from { transform: translateY(-10px) scale(.6); opacity: 0; } }
.d-spool-add canvas { opacity: .55; }
.d-spool-add b { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-2); font-size: 16px; }
/* the patch box: one soft tray with a stitched edge; a tab for each kind, then a fixed grid of patches at one scale (three rows tall, the rest scrolls) */
.d-box { width: min(100%, 372px); margin: 14px auto 0; padding: 6px 8px 8px; border-radius: 14px; background: #efe8d9; outline: 1.5px dashed #c9b48a; outline-offset: -5px; }
.d-tabs { display: flex; justify-content: center; gap: 2px; padding: 4px 0 6px; }
.d-tab { padding: calc(4px - var(--text-lift)) 9px calc(4px + var(--text-lift)); border: 0; border-radius: 999px; background: none; color: var(--ink-3); font: 12.5px/1.2 var(--sans); cursor: pointer; white-space: nowrap; }
.d-tab:hover { color: var(--ink); }
.d-tab[aria-selected="true"] { background: var(--paper); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px #d8cdb6; }
.d-drawer-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; max-height: 164px; padding: 2px 4px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #cdbf9f transparent; }
.d-patch { display: grid; place-items: center; aspect-ratio: 1; min-width: 0; padding: 7px; border: 0; border-radius: 10px; background: none; color: var(--ink-3); font-size: 20px; cursor: pointer; }
.d-patch canvas { width: 100%; height: 100%; image-rendering: pixelated; }
.d-patch:hover { background: rgba(255, 253, 248, .6); }
.d-patch[aria-pressed="true"] { background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--ink); }
.d-note { margin: 6px 6px 2px; padding: 0 0 0 16px; font-size: 12px; line-height: 1.5; color: var(--ink3, #8a8174); }
.d-note canvas { width: 14px; height: 14px; vertical-align: -2px; image-rendering: pixelated; }
.d-add { border: 1.5px dashed #c9b48a; background: none; }
/* dressing the book: around it each part's name over its color in pixel brackets, a line of running
   stitches from a knot by the name to a pin on the part; the picked one in ink */
.d-figure { position: relative; z-index: 1; display: block; }
.d-figure canvas { position: relative; z-index: 0; }
.d-leads { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.d-leads polyline { fill: none; stroke: #b6a07a; stroke-width: 2; stroke-dasharray: 5 4; stroke-linecap: butt; stroke-linejoin: round; }
.d-leads circle { fill: #b6a07a; }
.d-spot { position: absolute; z-index: 2; width: 22px; height: 22px; margin: -11px 0 0 -11px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.d-spot::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #fffdf8; box-shadow: 0 0 0 2px #b6a07a, 0 1px 3px rgba(0, 0, 0, .3); }
.d-spot:hover::after { transform: scale(1.2); }
.d-label { position: absolute; z-index: 3; display: grid; justify-items: center; gap: 3px; min-width: 52px; padding: 4px 6px; border: 0; background: none;
  transform: translateX(-50%); color: var(--ink-3); font: var(--pixel); white-space: nowrap; cursor: pointer; -webkit-font-smoothing: none; }
.d-label:hover { color: var(--ink); }
button.d-label:hover .d-chip i { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px var(--ink); }
.d-chip { display: inline-flex; align-items: center; gap: 2px; }
.d-chip i { display: inline-block; width: 16px; height: 14px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18); }
.d-off { position: absolute; z-index: 3; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: none;
  color: var(--ink-3); font-size: 14px; line-height: 18px; cursor: pointer; }
.d-off:hover { color: var(--ink); }
.d-thick { position: relative; cursor: pointer; }
.d-thick select { position: absolute; inset: 0; width: 100%; opacity: 0; font: inherit; cursor: pointer; }   /* unseen over its name */
.d-thick:focus-within { outline: 1.5px dashed var(--ink); outline-offset: 2px; }
div.d-label { cursor: default; }
.d-chip i.none { background: repeating-linear-gradient(45deg, #fffdf8 0 3px, #d9cfbd 3px 6px); }

/* keeping it: the stitched dark button, in the middle */
.d-actions { display: flex; justify-content: center; margin: 22px 0 40px; }
.d-save { min-width: 150px; padding: calc(12px - var(--text-lift)) 24px calc(12px + var(--text-lift)); border: 0; border-radius: 12px; background: #2b2622; color: #fffdf8; font: 600 15px var(--sans);
  letter-spacing: .06em; outline: 1.5px dashed #a79a80; outline-offset: -5px; cursor: pointer; }
.d-save:disabled { opacity: .6; cursor: default; }

/* ---------- one book: its head, the writing box, the line of entries ---------- */

/* the page of a book: one column, as a diary reads */
.d-page { max-width: 680px; margin: 0 auto; }

/* the head: the book (one's own: the way to its cover), whose it is, the title in Hahmlet */
.d-head { display: flex; align-items: center; gap: 18px; margin: 8px 0 22px; }
.d-coverlink { position: relative; flex: none; display: block; transition: transform .15s; }
a.d-coverlink:hover, a.d-coverlink:focus-visible { transform: translateY(-3px); outline: none; }
.d-cover-tip { position: absolute; z-index: 2; left: 50%; bottom: 2px; display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px 4px 8px;
  border-radius: 999px; background: var(--ink); color: var(--paper); font-size: 11px; white-space: nowrap; opacity: 0; transform: translate(-50%, 4px); transition: .15s; pointer-events: none; }
.d-cover-tip .px-icon { width: 14px; height: 14px; }
a.d-coverlink:hover .d-cover-tip, a.d-coverlink:focus-visible .d-cover-tip { opacity: 1; transform: translate(-50%, 0); }
/* a phone has no pointing: the way shows, as a small pen on the book's corner */
@media (hover: none) {
  .d-cover-tip { left: auto; right: 4px; top: 4px; bottom: auto; width: 26px; height: 26px; padding: 0; gap: 0; justify-content: center; font-size: 0; opacity: .92; transform: none; }
}
.d-who { min-width: 0; }
.d-who .eyebrow { margin: 0; }
.d-title2 { margin: 8px 0 6px; font: 600 20px/1.3 "Hahmlet", var(--sans); letter-spacing: -.01em; word-break: keep-all; overflow-wrap: anywhere; }
.d-rename { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-align: left; cursor: text; }
.d-rename .px-icon { color: var(--ink-3); opacity: 0; transition: opacity .15s; }
.d-rename:hover .px-icon, .d-rename:focus-visible .px-icon { opacity: 1; }
.d-rename:hover span { box-shadow: 0 2px 0 -.5px #c9b98f; }
@media (hover: none) { .d-rename .px-icon { opacity: .5; } }
.d-title-input { width: min(100%, 320px); padding: 0 0 2px; border: 0; border-bottom: 1.5px solid #c9b98f; background: none; color: var(--ink);
  font: 600 20px/1.3 "Hahmlet", var(--sans); letter-spacing: -.01em; outline: none; }
.d-by { margin: 0; color: var(--ink-3); font-size: 12px; }

.d-pop-label { margin: 0 0 6px; font-size: 11.5px; color: var(--ink-3); }
.d-pop-label:not(:first-child) { margin-top: 12px; }
.d-pop-row { display: flex; gap: 6px; }
.d-pop-input { flex: 1; min-width: 0; width: 260px; padding: 8px 10px; border: 0; border-radius: 8px; background: #f1ece2; color: var(--ink); font: inherit; outline: none; }
.d-pop-go { flex: none; padding: 0 12px; border: 0; border-radius: 8px; background: var(--ink); color: var(--paper); font: inherit; font-size: 13px; cursor: pointer; }
.d-pop-wait { padding: 14px 0 6px; font-size: 11.5px; color: var(--ink-3); text-align: center; }
.d-seg { display: flex; align-items: center; gap: 2px; margin: 0 0 8px; padding: 2px; border-radius: 999px; background: var(--sand); }
.d-seg button { flex: 1; padding: 6px 10px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-3); font: inherit; font-size: 12.5px; cursor: pointer; }
.d-seg button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.d-picks { display: grid; gap: 4px; max-height: 220px; overflow-y: auto; }
.d-pick { display: block; padding: 0; border: 0; border-radius: 6px; background: none; text-align: left; cursor: pointer; }
.d-pick .d-att { width: 100%; box-shadow: none; }
.d-pick:hover .d-att { background: #f1ece2; }

/* the writing box: a bar to open it; open, the day, the words, the tags, the pattern, and its buttons */
.d-composer { margin: 0 0 26px; border-radius: 14px; }
.d-composer .d-write { display: none; padding: 12px 14px 10px; }
.d-composer.open { background: #fff; box-shadow: 0 0 0 1px #e3dccd; }
.d-composer.open .d-compose { display: none; }
.d-composer.open .d-write { display: block; }
.d-compose { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; border: 0; border-radius: 12px; background: #ece6da;
  color: var(--ink-2); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.d-compose:hover { background: #e4dccd; }
/* the plus drawn, not typed: a glyph sits off its circle's middle by the font's own spacing */
.d-plus { flex: none; width: 22px; height: 22px; border-radius: 50%; color: var(--ink-3); box-shadow: inset 0 0 0 1px #d6cdbb;
  background: linear-gradient(currentColor, currentColor) center / 10px 2px no-repeat, linear-gradient(currentColor, currentColor) center / 2px 10px no-repeat, var(--paper); }
.d-draft-chip { margin-left: auto; color: var(--ink-3); font-size: 11.5px; white-space: nowrap; }
.d-write-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.d-day { display: inline-flex; align-items: baseline; gap: 4px; padding: 3px 7px; margin: -3px -7px; border: 0; border-radius: 8px; background: none; font: 600 14px/1.4 var(--sans); color: var(--ink); white-space: nowrap; cursor: pointer; }
.d-day:hover, .d-day[aria-expanded="true"] { background: #efe9dc; }
.d-caret { font-size: 11px; color: var(--ink-3); }
.d-day:focus-visible { outline: 1.5px dashed var(--ink-3); outline-offset: 2px; }
.d-kept { margin-left: auto; font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.d-x { flex: none; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--ink-3); font-size: 12px; cursor: pointer; }
.d-x:hover { background: var(--sand); color: var(--ink); }
.d-write-text { display: block; width: 100%; min-height: 66px; padding: 2px 0; border: 0; background: none; color: var(--ink); font: inherit; font-size: 14px; line-height: 1.6;
  resize: none; outline: none; word-break: keep-all; overflow-wrap: anywhere; }
.d-left { display: block; text-align: right; font-size: 11.5px; color: var(--ink-3); }
.d-left:empty { display: none; }
.d-left.bad { color: #a8433b; }

/* tags: grey till picked, then in their color; "+" a little outlined square */
.d-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 8px; }
.d-tg { flex-shrink: 0; height: 20px; padding: 0 7px calc(2 * var(--text-lift)); border: 0; border-radius: 6px; background: #f0ede7; color: #a39e95; font: inherit; font-size: 11px; font-weight: 500;
  line-height: 1; white-space: nowrap; cursor: pointer; -webkit-touch-callout: none; user-select: none; }
.d-tg:hover { color: #6d685f; }
.d-tg[aria-pressed="true"] { background: color-mix(in srgb, var(--c) 15%, #fff); color: var(--c); font-weight: 600; }
.d-tg-add { width: 20px; padding: 0; background: none; box-shadow: inset 0 0 0 1px #ddd3c2; font-weight: 400; font-size: 13px; }
.px-pop .d-tags { margin: 0; }
.px-pop .d-tg { color: var(--c); background: color-mix(in srgb, var(--c) 10%, #fff); }

/* the pattern: its picture on fabric, where it is, its name and size, a thin chevron */
.d-att { display: flex; align-items: center; gap: 12px; width: min(100%, 360px); margin-top: 12px; padding: 8px 14px 8px 8px; border-radius: 12px; background: #fff;
  box-shadow: 0 0 0 1px #e6dfd1; color: var(--ink); text-decoration: none; transition: box-shadow .15s; }
a.d-att:hover { box-shadow: 0 0 0 1px #cbbf9f, 0 8px 18px -14px rgba(0, 0, 0, .4); }
.d-fab { display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: 8px; background: #f2ecde; overflow: hidden; }
.d-fab img { display: block; width: 100%; height: 100%; object-fit: cover; }                 /* a link's preview: its picture on the fabric, filling it */
.d-fab img.d-px { width: 36px; height: 36px; object-fit: contain; image-rendering: pixelated; }   /* a post's stitches, a pixel each */
.d-tx { flex: 1; min-width: 0; }
.d-tx small { display: block; font-size: 10.5px; color: var(--ink-3); }
.d-tx b, .d-tx em { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-tx b { margin: 2px 0 1px; font-weight: 600; font-size: 13.5px; }
.d-tx em { font-style: normal; font-size: 11px; color: var(--ink-3); }
.d-go { flex: none; display: grid; place-items: center; width: 12px; color: #cdc5b6; transition: transform .15s, color .15s; }
.d-go .px-icon { width: 6px; height: 10px; }
a.d-att:hover .d-go { color: var(--ink-3); transform: translateX(2px); }
.d-att-gone { opacity: .6; }
.d-att-small { width: auto; max-width: 100%; margin: 0; padding: 4px 10px 4px 4px; gap: 8px; border-radius: 5px; }
.d-att-small .d-fab { width: 36px; height: 36px; border-radius: 3px; }
.d-att-small .d-fab img.d-px { width: 26px; height: 26px; }
.d-att-small .d-tx b { margin: 1px 0 0; font-size: 12.5px; }
.d-attached { display: flex; align-items: center; gap: 6px; max-width: 100%; margin: 2px 0 8px; }
.d-attached:empty { display: none; }

/* the box's photos: small squares in a row, each with its ✕; one on its way pale */
.d-shots { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 8px; }
.d-shots:empty { display: none; }
.d-shot { position: relative; width: 64px; height: 64px; border-radius: 6px; overflow: hidden; background: #f1ece2; }
.d-shot img { display: block; width: 100%; height: 100%; object-fit: cover; }
.d-shot .d-x { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: rgba(17, 17, 17, .6); color: #fff; font-size: 10px; }
.d-shot .d-x:hover { background: var(--ink); color: #fff; }
.d-shot-wait img { opacity: .45; }
.d-shot-wait::after { content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border: 2px solid #fff;
  border-right-color: transparent; border-radius: 50%; animation: d-spin .8s linear infinite; }
@keyframes d-spin { to { transform: rotate(360deg); } }

/* an entry's photos one under another, each as wide as the entry (as a blog shows them) */
.d-photos { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.d-photo { display: block; width: 100%; height: auto; border-radius: 10px; background: #ece6da; }

/* the box's buttons: the two ways to a pattern, then who may read it, keeping it for later, the stitched save */
.d-wbar { display: flex; align-items: center; gap: 2px; padding-top: 8px; border-top: 1px solid #efe9de; }
.d-tool { display: inline-flex; flex-shrink: 0; align-items: center; gap: 5px; padding: 6px 10px 6px 8px; border: 0; border-radius: 999px; background: none;
  color: var(--ink-3); font: inherit; font-size: 12.5px; white-space: nowrap; cursor: pointer; }
.d-tool .px-icon { color: var(--ink); }
.d-tool:hover, .d-tool[aria-expanded="true"] { background: #ece6da; color: var(--ink); }
.d-grow { flex: 1; }
.d-draftb { flex-shrink: 0; margin-left: 4px; padding: 7px 10px; border: 0; border-radius: 9px; background: none; color: var(--ink-2); font: inherit; font-size: 13px; white-space: nowrap; cursor: pointer; }
@media (hover: hover) { .d-draftb:hover { background: #ece6da; } }   /* (a tap doesn't leave it lit) */
.d-save-sm { flex-shrink: 0; min-width: 0; margin-left: 2px; padding: calc(8px - var(--text-lift)) 18px calc(8px + var(--text-lift)); border-radius: 10px; font-size: 13px; outline-offset: -4px; white-space: nowrap; }

/* the line of entries */
.d-empty { margin: 10px 0 0; color: var(--ink-3); font-size: 13px; text-align: center; }
.d-tl { list-style: none; margin: 0; padding: 0; }
.d-tl > li { display: grid; grid-template-columns: 44px 18px 1fr; gap: 0 14px; }
.d-tl > .d-year { display: block; margin: 0 0 14px; }
.d-tl > .d-year:not(:first-child) { margin-top: 6px; }
.d-year b { font: 600 13px/1 var(--sans); color: var(--ink-3); }
.d-date { padding-top: 1px; text-align: right; line-height: 1; }
.d-date b { display: block; font: 600 24px/1 var(--sans); }
.d-date span { display: block; margin-top: 6px; font: 400 11.5px/1 var(--sans); color: var(--ink-3); white-space: nowrap; }
.d-rail { position: relative; }
.d-rail::after { content: ""; position: absolute; left: 50%; top: 24px; bottom: -2px; width: 2px; margin-left: -1px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2' height='11'%3E%3Cline x1='1' y1='1' x2='1' y2='6' stroke='%23c4b28f' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") repeat-y; }
.d-tl > li:last-child .d-rail::after, .d-tl > li:has(+ .d-year) .d-rail::after { display: none; }
/* the knot on the line: a French knot, a round bead of thread; an entry with no tag's small and quiet */
.d-knot { position: absolute; left: 50%; top: 7px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--c);
  box-shadow: inset -2px -2px 0 rgba(0, 0, 0, .14), inset 1.5px 1.5px 0 rgba(255, 255, 255, .35); }
.d-plain .d-knot { top: 9px; width: 7px; height: 7px; margin-left: -3.5px; box-shadow: none; }
.d-ebody { position: relative; min-width: 0; padding: 0 0 30px; }
.d-tl > li:last-child .d-ebody { padding-bottom: 0; }
.d-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 24px; }
.d-plain .d-meta { position: absolute; top: 2px; right: 0; }
.d-mk { display: inline-flex; flex-shrink: 0; align-items: center; height: 20px; padding: 0 7px calc(2 * var(--text-lift)); border-radius: 6px; background: color-mix(in srgb, var(--c) 13%, #fff);
  color: var(--c); font-size: 11px; font-weight: 500; line-height: 1; white-space: nowrap; }
.d-lk { display: inline-flex; color: var(--ink); }
.d-more-at { margin-left: auto; }
.d-more-at:empty { display: none; }
.d-more { display: grid; place-items: center; width: 26px; height: 22px; padding: 6px; border: 0; border-radius: 6px; background: none; color: var(--ink-3); cursor: pointer; }
.d-more .px-icon { width: 14px; height: 5px; }
.d-more:hover, .d-more[aria-expanded="true"] { background: var(--sand); color: var(--ink); }
.d-text { margin: 8px 0 0; color: var(--ink-2); font-size: 14px; line-height: 1.7; white-space: pre-line; word-break: keep-all; overflow-wrap: anywhere; }
.d-plain .d-ebody { min-height: 86px; }
.d-plain .d-text { margin-top: 2px; padding-right: 64px; }
.d-plain:not(:has(.d-lk)) .d-text { padding-right: 34px; }

@media (max-width: 520px) {
  .d-head { gap: 14px; }
  .d-coverlink .diary-sprite { max-width: 112px; height: auto !important; }
  .d-wbar { flex-wrap: wrap; row-gap: 6px; }
  .d-wbar .d-grow { flex: 1 0 100%; height: 0; }
  /* the tools a row; the two saves the next, the whole width: keep a third, write two */
  .d-draftb { flex: 1 1 0; margin: 0; padding: 10px; border: 1px solid #e3dccf; border-radius: 10px; text-align: center; }
  .d-save-sm { flex: 2 1 0; margin-left: 8px; padding: calc(10px - var(--text-lift)) 10px calc(10px + var(--text-lift)); }
  .d-tool { padding: 6px 9px 6px 7px; font-size: 13px; }
  .d-write-head { flex-wrap: wrap; row-gap: 2px; }
  .d-write-head .d-x { margin-left: auto; }          /* the close on the day's row; when the draft was kept, under it */
  .d-kept { order: 1; flex-basis: 100%; margin-left: 0; }
  .d-kept:empty { display: none; }
}

/* reporting someone else's entry (timeline.js menu, report.js dialog), and one's own hidden by reports */
.d-hidden .d-ebody > :not(.d-hidden-note) { opacity: .45; }
.d-hidden-note { margin: 0 0 10px; padding: 9px 11px; border-radius: 10px; background: #f3e4dc; color: #7a3a2e;
                 font-size: 12px; line-height: 1.55; word-break: keep-all; }
/* under the photos chosen: they're kept small, so many at most */
.d-shot-note { display: block; margin: -4px 0 8px; font-size: 11.5px; color: var(--ink-3); }

/* the day's calendar (daypick.js): a month, the chosen day a green pixel tile (the site's buttons' corners), today a dot under */
.d-cal { width: 266px; }
.d-cal-top { display: flex; align-items: center; gap: 4px; margin: -2px 0 6px 4px; }
.d-cal-top b { flex: 1; font: 500 14px var(--sans); }
.d-cal-nav { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--ink-2); cursor: pointer; }
.d-cal-nav .px-icon { width: 6px; height: 10px; }
.d-cal-nav:hover:not(:disabled) { background: #f1ece2; }
.d-cal-nav:disabled { opacity: .25; cursor: default; }
.d-cal-week, .d-cal-days { display: grid; grid-template-columns: repeat(7, 1fr); }
.d-cal-week span { padding: 2px 0 6px; text-align: center; font-size: 11px; color: var(--ink-3); }
.d-cal-days button { position: relative; min-width: 0; height: 36px; padding: 0; border: 0; background: none; font: 400 13px var(--mono); color: var(--ink-2); cursor: pointer; }
.d-cal-days button span { display: grid; place-items: center; width: 32px; height: 32px; margin: 0 auto; }
.d-cal-days button:hover:not(:disabled) span { background: #f1ece2; }
.d-cal-days button:disabled { color: #cfc8ba; cursor: default; }
.d-cal-days .today span::after { content: ""; position: absolute; bottom: 3px; left: 50%; width: 4px; height: 4px; margin-left: -2px; background: #5f7d4a; }
.d-cal-days .on span { background: #5f7d4a !important; color: #fffbe9; font-weight: 500; box-shadow: inset 0 0 0 1px #3f5530, inset 0 -3px 0 #4a6339;
  clip-path: polygon(0 2px, 1px 2px, 1px 1px, 2px 1px, 2px 0, calc(100% - 2px) 0, calc(100% - 2px) 1px, calc(100% - 1px) 1px, calc(100% - 1px) 2px, 100% 2px,
    100% calc(100% - 2px), calc(100% - 1px) calc(100% - 2px), calc(100% - 1px) calc(100% - 1px), calc(100% - 2px) calc(100% - 1px), calc(100% - 2px) 100%,
    2px 100%, 2px calc(100% - 1px), 1px calc(100% - 1px), 1px calc(100% - 2px), 0 calc(100% - 2px)); }
.d-cal-days .on.today span::after { background: #fffbe9; }
.d-cal-foot { margin-top: 4px; padding: 8px 4px 0; border-top: 1px solid #efe9dc; }
.d-cal-today { padding: 2px 0; border: 0; background: none; font: 500 12.5px var(--sans); color: var(--ink-2); text-decoration: underline; text-decoration-color: #cfc6b4; text-underline-offset: 3px; cursor: pointer; }

/* under an entry (reactions.js): a heart and a bubble with their counts, and the comments the bubble opens */
.d-acts { display: flex; justify-content: flex-end; align-items: center; gap: 16px; margin-top: 10px; }
.d-act { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 2px; border: 0; background: none;
         color: var(--ink-3); font: 400 12.5px/1 var(--sans); cursor: pointer; }
.d-act .d-glyph { display: block; width: 14px; height: 13px; transform: translateY(.75px); }   /* its middle on the digits' middle */
.d-act .d-n { font-variant-numeric: tabular-nums; }
.d-act.on { color: var(--ink); }
.d-act:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
.d-dot { position: absolute; top: 5px; left: 13px; width: 6px; height: 6px; border-radius: 50%; background: #c4452b; box-shadow: 0 0 0 2px var(--paper); }
.d-talk { margin-top: 8px; padding-top: 12px; border-top: 2px dotted #e0d4bd; }
.d-talk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.d-talk-item { display: grid; gap: 3px; }
.d-talk-item.fresh { margin: -4px -10px; padding: 6px 10px; border-radius: 10px; background: #f5ece3; }
.d-talk-who { display: flex; align-items: center; gap: 6px; min-height: 22px; font-size: 12px; color: var(--ink-3); }
.d-talk-who b { font-weight: 600; font-size: 12.5px; color: var(--ink); overflow-wrap: anywhere; }
.d-talk-who .d-handle { white-space: nowrap; }
.d-host { padding: 0 6px; border: 1px solid #d9cfbd; border-radius: 999px; font-size: 10.5px; line-height: 16px; color: var(--ink-2); white-space: nowrap; }
.d-talk-when { white-space: nowrap; }
.d-new { color: #b5483b; font-weight: 600; font-size: 11px; letter-spacing: .02em; }
.d-talk-act { margin-left: auto; display: flex; }
.d-talk-x, .d-talk-more { display: grid; place-items: center; width: 24px; height: 22px; padding: 5px; border: 0; border-radius: 6px; background: none; color: var(--ink-3); cursor: pointer; }
.d-talk-x .px-icon { width: 10px; height: 10px; }
.d-talk-more .px-icon { width: 12px; height: 4px; }
.d-talk-x:hover, .d-talk-more:hover, .d-talk-more[aria-expanded="true"] { background: var(--sand); color: var(--ink); }
.d-talk-text { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--ink-2); white-space: pre-line; word-break: keep-all; overflow-wrap: anywhere; }
.d-talk-note { margin: 0; font-size: 12.5px; color: var(--ink-3); }
.d-talk-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; margin-top: 14px; }   /* (never wider than the entry: a phone's textarea asks for more) */
.d-talk-list:empty + .d-talk-form, .d-talk > .d-talk-form:first-child { margin-top: 0; }
/* the box: 등록 rides the last line (the middle of one line); the box grows with the text, five lines at most */
.d-talk-box { --line: calc(13.5px * 1.5 + 14px); display: flex; align-items: flex-end; gap: 6px; min-width: 0; padding: 4px 4px 4px 12px; border: 1px solid transparent; border-radius: 12px; background: #efeae0; }
.d-talk-form.open .d-talk-box { border-color: #d9cfbd; background: #fbf9f4; }
.d-talk-txt { flex: 1; width: 0; min-width: 0; max-height: calc(var(--line) + 4 * (var(--line) - 14px)); padding: 7px 0; border: 0; background: none; color: var(--ink);
              font: 400 13.5px/1.5 var(--sans); resize: none; outline: none; overflow-y: auto; }
.d-talk-txt::placeholder, .d-talk-in::placeholder { color: #a39d92; }
.d-talk-txt::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* one line, whatever the language (the box is one line until written in) */
.d-talk-send { flex: none; height: 30px; margin-bottom: calc((var(--line) - 30px) / 2); padding: 0 12px calc(2 * var(--text-lift)); border: 0; border-radius: 9px;
               background: var(--ink); color: var(--paper); font: 500 12.5px var(--sans); cursor: pointer; }
.d-talk-send:disabled { background: #d9d2c4; color: #fff; cursor: default; }
/* under it, once writing: small soft fields for a visitor's name and password, the count at the end */
.d-talk-meta { display: none; }
.d-talk-form.open .d-talk-meta { display: flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 2px; font-size: 11.5px; color: var(--ink-3); }
.d-talk-field { flex: 1 1 0; min-width: 0; max-width: 110px; height: 28px; }   /* (wide enough for "Anonymous"; the phone's column is ~250px) */
.d-talk-field.pw { flex-grow: 1.4; max-width: 160px; }
.d-talk-in { display: block; width: 100%; height: 100%; padding: 0 8px; border: 0; border-radius: 8px; background: #efeae0; color: var(--ink); font: 400 13px var(--sans); outline: none; }
.d-talk-in:focus { box-shadow: inset 0 0 0 1px #c9bda6; }
.d-talk-count { margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }
.d-talk-count.over { color: #b5483b; }
@media (pointer: coarse) {
  /* a phone's fields are 16px (tokens.css, or it zooms in): the text box's lines are that tall, and the small fields are drawn at 13/16 */
  .d-talk-box { --line: calc(16px * 1.5 + 14px); }
  .d-talk-in { --s: calc(13 / 16); width: calc(100% / var(--s)); height: calc(100% / var(--s)); padding: 0 calc(8px / var(--s)); border-radius: calc(8px / var(--s));
               transform: scale(var(--s)); transform-origin: 0 0; }
}
.d-talk-foot { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 12px; font-size: 12px; color: var(--ink-3); }
.d-talk-foot span { margin-right: auto; }
.d-talk-switch { padding: 0; border: 0; background: none; color: var(--ink-3); font: inherit; text-decoration: underline; text-decoration-color: #cfc6b4;
                 text-underline-offset: 3px; cursor: pointer; }
/* the head of one's own book: comments new to them, the way to the first entry with some */
.d-news { padding: 0; border: 0; background: none; color: #b5483b; font: inherit; font-weight: 500; cursor: pointer; }
.d-news::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 5px 1px 0; border-radius: 50%; background: #c4452b; vertical-align: middle; }

/* the finished pieces (pieces.js): two squares a card, the pattern beside the photo of it done */
.d-pc-note { margin: -12px 0 18px; font-size: 13px; color: var(--ink-3); }
.d-pcs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 24px 18px; margin-bottom: 40px; }
.d-pc { display: block; min-width: 0; color: inherit; text-decoration: none; }
.d-pc-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; border-radius: 12px; overflow: hidden; background: #e6dfd1; }
.d-pc-sq { position: relative; margin: 0; aspect-ratio: 1; background: #f2ecde; }
.d-pc-sq img { display: block; width: 100%; height: 100%; }
.d-pc-photo { object-fit: cover; }                                   /* any shape, cut to the square from its middle */
.d-pc-pat { padding: 4%; object-fit: contain; }                    /* a link's preview: on its own bit of fabric */
.d-pc-pat.d-px { padding: 14%; image-rendering: pixelated; }         /* a post's stitches: a pixel a stitch */
.d-pc-sq figcaption { position: absolute; left: 8px; bottom: 8px; padding: calc(2px - var(--text-lift)) 7px calc(2px + var(--text-lift)); border-radius: 999px;
                      background: rgba(255, 253, 248, .9); color: var(--ink-2); font-size: 11px; line-height: 16px; }
.d-pc-none { display: grid; place-items: center; aspect-ratio: 1; background: #efe9dd; color: #b3aa9a; font-size: 12px; }
.d-pc-meta { display: flex; align-items: baseline; gap: 8px; min-width: 0; margin-top: 8px; padding: 0 2px; font-size: 12.5px; color: var(--ink-3); }
.d-pc-meta b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; color: var(--ink); }
.d-pc-by { flex: none; white-space: nowrap; }
.d-pc-n { display: flex; gap: 10px; margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.d-pc-n span { display: inline-flex; align-items: center; gap: 4px; }
.d-pc-n .d-glyph { width: 12px; height: 11px; transform: translateY(.5px); }
.d-pc:hover .d-pc-meta b { text-decoration: underline; text-underline-offset: 4px; }
.d-ent { scroll-margin-top: 16px; }                                  /* brought to from a finished piece */

/* above a book's entries: its tags, to see only those with any picked (tagfilter.js); one line, slid across when long */
.d-filter { display: flex; gap: 6px; margin: 2px 0 22px; padding-bottom: 2px; overflow-x: auto; scrollbar-width: none; }
.d-filter::-webkit-scrollbar { display: none; }
.d-ft { flex: none; display: inline-flex; align-items: center; height: 26px; padding: 0 11px calc(2 * var(--text-lift)); border: 0; border-radius: 999px;
        background: #efeae0; color: var(--ink-2); font: 500 12px var(--sans); white-space: nowrap; cursor: pointer; }
.d-ft i { width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--c); }
.d-ft[aria-pressed="true"] { background: var(--c, var(--ink)); color: #fff; }
.d-ft[aria-pressed="true"] i { background: #fff; opacity: .85; }
.d-ft:focus-visible, button.d-mk:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
button.d-mk { border: 0; font-family: inherit; cursor: pointer; }   /* a tag on an entry: the book seen by it */

/* the dialog a tag is made or changed in (tagdialog.js): the name, the tag big in the middle (pressed: on and off), the colors */
.d-tagdlg { width: min(360px, calc(100vw - 32px)); }
.d-tagdlg h2 { margin: 0 0 14px; font: 600 16px var(--sans); }
.d-tagdlg-name { width: 100%; }
.d-tagdlg-stage { display: grid; justify-items: center; gap: 12px; margin: 16px 0; padding: 26px 12px 16px; border-radius: 14px; background: #efe9dd; }
.d-tagdlg-stage .d-tg { height: 40px; padding: 0 18px calc(2 * var(--text-lift)); border-radius: 12px; font-size: 18px;      /* the writing box's tag, twice as big */
                         box-shadow: 0 2px 0 rgba(60, 40, 20, .12); }
.d-tagdlg-try { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--ink-3); }
.d-tagdlg-try svg { width: 16px; height: 16px; }
.d-tagdlg .d-pop-label { margin: 16px 0 8px; }
.d-tagdlg .g-actions { margin-top: 20px; }
.px-menu .danger { color: #b5483b; }

