/* The download flow (/download-flow.js; lib/download-flow.js). The cards are tools board E's
   (design/printables-2026-11/tools.html .st, .prog, .badge), the ok card, the book offer and Keep
   the fun going the phone board's (phone.html .ok, .next, .cov, .more, .kf), the toast the main
   board's (main.html .toast). Tokens and buttons are web/app/styles/design.css's; nothing here
   types a colour of its own. The panel sits in the page below the download controls, the main
   column's width up to 720px; nothing modal. */
.df { max-width: 720px; display: grid; gap: 16px; margin: 20px 0 0; }
.df[hidden], .df [hidden], .df-toast[hidden] { display: none; }
.df-state:empty { display: none; }
.df-after { display: grid; gap: 16px; }
.df-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* tools board E: Making, couldn't make it, offline */
.df-st { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-20); padding: 24px; display: grid; gap: 12px; align-content: start; }
.df-st b { font: 400 var(--text-22)/1.2 var(--font-display); }
.df-st p { margin: 0; font: 400 var(--text-14)/1.55 var(--font-ui); color: var(--muted); }
.df-st .tj-btn { justify-self: start; }
.df-prog { height: 8px; border-radius: var(--radius-pill); background: var(--sunk); overflow: hidden; }
.df-prog i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: var(--radius-pill); transition: width .3s ease; }
/* one PDF has no steps to count: the bar runs until it comes */
.df-prog-on i { width: 40%; animation: df-run 1.4s ease-in-out infinite; }
@keyframes df-run { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@media (prefers-reduced-motion: reduce) { .df-prog-on i { animation: none; width: 100%; opacity: .5; } }
.df-badge { width: 44px; height: 44px; border-radius: var(--radius-pill); display: flex; align-items: center; justify-content: center; }
.df-failed { background: var(--orange-tint); }
.df-offline { background: var(--sunk); }

/* the phone board's ok card */
.df-ok { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-20); padding: 18px; display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: center; }
.df-tick { width: 44px; height: 44px; border-radius: var(--radius-pill); background: var(--accent-tint); color: var(--accent-dark); display: flex; align-items: center; justify-content: center; }
.df-tick svg { width: 18px; height: 18px; }
.df-ok b { font: 600 var(--text-16) var(--font-ui); display: block; }
.df-ok span { font: 400 var(--text-13) var(--font-ui); color: var(--muted); }
.df-ok a { color: var(--ink); font-weight: 600; }

/* the book offer */
.df-next { background: var(--slab); color: var(--on-slab); border-radius: var(--radius-20); padding: 20px; display: grid; gap: 12px; position: relative; overflow: hidden; }
.df-eyebrow { margin: 0; font: 700 var(--text-12) var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--spark); }
.df-cov { height: 170px; border-radius: var(--radius-12); background: var(--bloom-mint); position: relative; overflow: hidden; }
.df-cov img { position: absolute; right: 8px; bottom: 0; height: 150px; }
.df-next h2 { font: 400 var(--text-30)/1.1 var(--font-display); margin: 0; }
.df-next p { margin: 0; font: 400 var(--text-14)/1.5 var(--font-ui); color: color-mix(in srgb, var(--on-slab) 78%, transparent); }
.df-from { font: 600 var(--text-13) var(--font-ui); }

/* Keep the fun going */
.df-more { display: grid; gap: 10px; }
.df-more .df-row b { font: 600 var(--text-16) var(--font-ui); }
.df-more .df-row a { font: 600 var(--text-13) var(--font-ui); color: var(--ink); }
.df-kf { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.df-kf a { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-12); overflow: hidden; text-decoration: none; color: var(--ink); }
.df-kf .w { height: 96px; background: var(--artwell); display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--artwell-line); }
.df-kf .w img { max-height: 84px; max-width: 85%; object-fit: contain; }
.df-kf .t { display: block; padding: 8px; font: 600 var(--text-12)/1.3 var(--font-ui); }

/* the hub's toast (main board .toast), fixed in the window: bottom right on a computer, the foot
   of the screen on a phone, so Making, ready and offline are seen wherever Download was pressed
   (Anurag, 14 November 2026: "light circled the button for a while and then nothing happened";
   above the filters it sat under the sticky header or off the screen). */
.df-toast { position: fixed; right: 20px; bottom: 20px; width: 380px; max-width: calc(100vw - 40px); box-sizing: border-box; background: var(--slab); color: var(--on-slab);
  border-radius: var(--radius-20); padding: 20px; box-shadow: var(--shadow-float); display: grid; gap: 10px; z-index: var(--z-toast); }
.df-toast-in { display: grid; gap: 10px; }
.df-toast h4 { margin: 0; font: 400 var(--text-22) var(--font-display); }
.df-toast p { margin: 0; font: 400 var(--text-13)/1.5 var(--font-ui); color: color-mix(in srgb, var(--on-slab) 78%, transparent); }
.df-toast .df-row { justify-content: flex-start; }
.df-toast-next { border-top: 1px solid var(--glass-edge); padding-top: 10px; }
.df-toast .tj-btn.glass { color: var(--on-slab); border-color: var(--glass-edge); background: transparent; }
/* a card of E inside the toast keeps the toast's dark */
.df-toast .df-st { background: transparent; border: 0; padding: 0; color: var(--on-slab); }
.df-toast .df-st p { color: color-mix(in srgb, var(--on-slab) 78%, transparent); }
.df-toast .df-st .tj-btn:not(.glass) { justify-self: start; }
@media (max-width: 720px) {
  .df-toast { left: 16px; right: 16px; bottom: 16px; width: auto; max-width: none; }
}

/* a world's activity mini as a Download (lib/printables-world.js miniForm): the board's card,
   the whole card the button */
.pw-mini-f > button { all: unset; display: block; width: 100%; box-sizing: border-box; cursor: pointer; }
.pw-mini-f:hover { border-color: var(--line-strong); box-shadow: var(--shadow-rest); }
.pw-mini-f:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.pw-mini-f[aria-busy="true"] { opacity: .6; }

/* the hub (lib/printables-hub.js): the hero pack beside the result line (main board .studio .row),
   the toast's anchor above the filters, a puzzle card's Download in place */
.df-packrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.df-packrow .ph-hint { margin: 0; }
.df-pack[hidden] { display: none; }
.df-pack .tj-btn svg { width: 16px; height: 16px; }
.df-anchor { position: relative; }
.df-inplace { display: contents; }
