/* Yu Yue's machine: a framed screen with three pages. One and two are plates
   (the system map, the production containers) and the frame is as tall as the
   drawing, up to what the column has; past that the screen scrolls. Three is
   the workspace's files: the frame fills the column. Her room below takes
   what is left (companion.css). */
.machine, .yard { width: 100%; max-width: 1080px; }
.machine {
  container-type: inline-size;
  position: relative;
  z-index: 1;
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 220px;
  padding: clamp(8px, .9vw, 14px) clamp(9px, 1.2vw, 20px) 0;
  border: 1px solid var(--ink);
  border-radius: 14px 14px 7px 7px;
  box-shadow: 1.5px 2.5px var(--bg), 2.5px 3.5px var(--ink2);
  view-transition-name: machine;
}
.machine::before, .machine::after { content: ""; position: absolute; bottom: -7px; width: 20px; height: 3px; background: var(--ink2); border-radius: 0 0 2px 2px; }
.machine::before { left: 7%; }
.machine::after { right: 7%; }
.machine-trim { flex: none; display: flex; justify-content: space-between; align-items: center; height: 21px; margin-top: 7px; border-top: 1px solid var(--rule); color: var(--ink2); }
.machine-trim svg { width: 44px; height: 8px; fill: none; stroke: currentColor; stroke-width: 1.15; stroke-linecap: round; }
.machine-trim::after { content: ""; position: absolute; left: 77%; bottom: -7px; width: 5px; height: 6px; transform: translateX(-50%); border: 1px solid var(--ink2); border-radius: 0 0 1px 1px; background: var(--bg); }
/* The lamp on the trim is the agent backend: lit when it answers, blinking while a turn runs. */
.lamp-led circle { transition: fill .3s; }
.machine[data-backend="ready"] .lamp-led circle { fill: currentColor; }
.machine[data-busy] .lamp-led circle { animation: led 1.2s steps(2, jump-none) infinite; }
@keyframes led { to { fill: transparent; } }

.pages { flex: none; display: flex; align-items: baseline; gap: clamp(14px, 2.4cqw, 26px); padding: 0 5px 7px; margin-bottom: clamp(8px, 1cqw, 12px); border-bottom: 1px solid var(--rule); }
.page { flex: none; padding: 0 0 1px; border: 0; border-bottom: 1px solid transparent; background: none; font-family: var(--sc); font-size: 14px; letter-spacing: .16em; color: var(--ink2); white-space: nowrap; }
/* A small square before each name: open for a page that is not on the screen, inked in for the one that is. */
.page i { display: inline-block; width: 6px; height: 6px; margin-right: 8px; border: 1px solid var(--ink3); vertical-align: 1.5px; transition: background-color .2s, border-color .2s; }
.page:hover { color: var(--ink); }
.page:hover i { border-color: var(--ink); }
.page.on { color: var(--ink); border-bottom-color: var(--ink); }
.page.on i { border-color: var(--ink); background: var(--ink); }
.screen { flex: 1 1 auto; min-height: 0; overflow: hidden auto; scrollbar-width: thin; view-transition-name: screen; }

/* ── Plates: the map and the containers ───────────────────────── */
.fig { position: relative; }
.fig > svg.draw { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.draw .fr { fill: none; stroke: var(--ink2); stroke-width: .85; }
.draw .gl { fill: none; stroke: var(--ink2); stroke-width: .85; }
.draw .dot { fill: var(--ink); stroke: none; }
/* A plate inks itself in once when it first appears. */
.fig.inking .draw .fr { stroke-dasharray: 2400; animation: ink-band 1s cubic-bezier(.3, .1, .2, 1) both; }
.fig.inking .m:not(.wip, .slot, .planned) .mf .o { stroke-dasharray: 560; animation: ink-box .7s calc(.12s + var(--i, 0) * .035s) cubic-bezier(.3, .1, .2, 1) both; }
.fig.inking .ml, .fig.inking .link, .fig.inking .ground, .fig.inking .layer > header { animation: fade-in .6s .25s both; }
@keyframes ink-band { from { stroke-dashoffset: 2400; } to { stroke-dashoffset: 0; } }
@keyframes ink-box { from { stroke-dashoffset: 560; } to { stroke-dashoffset: 0; } }
@keyframes fade-in { from { opacity: 0; } }

.layer { position: relative; padding: 8px 14px 11px; }
.layer > header { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 7px; }
.lyr { font-family: var(--sc); font-size: 14px; letter-spacing: .14em; white-space: nowrap; }
.lyr b { font-weight: 700; margin-right: 10px; }
.lpath { font-style: italic; font-size: 14px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); grid-auto-rows: 39px; gap: 7px 12px; }
/* A layer with a module outside its frame: the frame holds three columns, the fourth cell stands beside it on the
   same row, and its right edge meets the right edge of the layers below. */
.band { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); column-gap: 12px; align-items: end; }
.band > .layer { --cols: 3; }
.band > .aside { display: grid; grid-auto-rows: 39px; gap: 7px; padding-bottom: 11px; }
.module-detail { margin-top: 10px; padding-top: 8px; border-top: 1px dotted var(--rule); font-size: 13px; line-height: 1.6; }
.module-detail p { margin: 2px 0 5px; color: var(--ink2); }
.module-detail div b { margin-right: .8em; }
.module-detail code { font-size: 12px; }
.module-detail .rel { color: var(--ink2); }

@container (max-width: 465px) {
  .layer, .band > .layer { --cols: 2; }
  .grid { column-gap: 7px; }
}

.link { display: grid; grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr); align-items: center; gap: 9px; min-height: 29px; font-size: 12px; line-height: 1.2; color: var(--ink2); }
.link .dn { text-align: right; }
.link svg { width: 40px; height: 24px; overflow: visible; }
.arr { fill: none; stroke: var(--ink); stroke-width: 1.1; opacity: .7; transition: stroke-width .35s, opacity .35s; }
.arr.hot { stroke-width: 2.1; opacity: 1; }

.ground { display: flex; justify-content: flex-end; padding: 18px 7px 0; font-size: 12px; color: var(--ink2); }
.legend { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend svg, .svc svg { width: 19px; height: 11px; overflow: visible; }
:is(.legend, .svc) .o { fill: none; stroke: var(--ink); stroke-width: 1.1; }
:is(.legend, .svc) .thick { stroke-width: 2.2; }
:is(.legend, .svc) .thin { stroke-width: .8; }
:is(.legend, .svc) .dash { stroke-dasharray: 4 3; }
:is(.legend, .svc) .dots { stroke-dasharray: 1.2 3.4; stroke-width: 1.6; }
:is(.legend, .svc) .hA { fill: url(#hA); }
:is(.legend, .svc) .hA2 { fill: url(#hA2); }

/* A module: an ink frame drawn to the box's measured size (plate.js). */
.m { position: relative; min-width: 0; padding: 0; border: 0; background: var(--bg); display: flex; align-items: center; justify-content: center; text-align: center; }
.m .mf { position: absolute; left: -6px; top: -6px; overflow: visible; pointer-events: none; }
.mf .h { fill: none; stroke: none; }
.mf .o { fill: none; stroke: var(--ink); stroke-width: 1.15; transition: stroke-width .25s; }
.mf .d { fill: none; stroke: var(--ink); stroke-width: .9; opacity: 0; transition: opacity .3s; }
.m:hover .mf .o { stroke-width: 1.7; }
.m.sel .mf .h { fill: url(#hA); }
.m.sel .mf .o { stroke-width: 2.3; }
.m.now .mf .d { opacity: 1; }
.m.wip .mf .o { stroke-dasharray: 5 3.5; }
.m.wip .mf .h { fill: url(#hA2); }
.m.wip.sel .mf .h { fill: url(#hA); }
.m.slot .mf .o, .m.planned .mf .o { stroke-dasharray: 1.2 4; stroke-width: 1.7; }
.m:focus-visible { outline: 1px dashed var(--ink); outline-offset: 9px; }
.m .ml { position: relative; display: flex; flex-direction: column; align-items: center; min-width: 0; max-width: 100%; line-height: 1.2; padding: 1px 8px; }
.m.sel .ml { background: var(--bg); }
.m .ml b { font-weight: 600; font-size: 15px; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.m .ml small { font-family: var(--sc); font-size: 12px; letter-spacing: .07em; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
#fig .m.now .ml b { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.layer[data-layer="L1"] .m .ml { line-height: 1.1; }
.layer[data-layer="L1"] .m .ml b { font-size: 14.5px; }
/* The order a demo visited this module: vertical numerals on the left edge. */
.m .bd { position: absolute; z-index: 2; left: -11px; top: 50%; transform: translateY(-50%); font-family: var(--han); font-size: 15px; line-height: 1; padding: 2px 1px; background: var(--bg); writing-mode: vertical-lr; text-orientation: upright; letter-spacing: 2px; }
.m .bd:empty { display: none; }
/* Open alerts on this module: a reference mark and a count. */
.m .mk { position: absolute; z-index: 2; right: -7px; top: -9px; padding: 0 3px; background: var(--bg); font-family: var(--sc); font-size: 12px; letter-spacing: .04em; color: var(--ink); }
.m .mk:empty { display: none; }
.m .mk.critical { font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }

/* ── Plate two: one can per environment (deploy.js) ───────────── */
#plate { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.stage { grid-area: 1 / 1 / 2 / 3; position: relative; }
.stage > svg.draw { position: absolute; left: 0; top: 0; z-index: 1; overflow: visible; pointer-events: none; }
.draw .room { fill: none; stroke: none; }
.cable { fill: none; stroke: var(--ink); stroke-width: 1; }
.can { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--lid, 24px) 4px 5px; border: 0; background: none; text-align: center; }
.can > svg { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.can .h { fill: var(--bg); stroke: none; }
.can .o { fill: none; stroke: var(--ink); stroke-width: 1.2; transition: stroke-width .25s; }
.can .lid { fill: var(--bg); }
.can .fine { fill: none; stroke: var(--ink2); stroke-width: .7; }
@media (hover: hover) { .can:hover .o { stroke-width: 1.8; } }
.can.sel .h { fill: url(#hA); }
.can.sel .o { stroke-width: 2.3; }
.can:focus-visible { outline: 1px dashed var(--ink); outline-offset: 5px; }
.can .ml { position: relative; display: flex; flex-direction: column; align-items: center; max-width: 100%; padding: 1px 6px; line-height: 1.25; }
.can.sel .ml { background: var(--bg); }
.can .ml b { max-width: 100%; font-weight: 600; font-size: 14px; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.can.core .ml b { font-size: 15px; }
.can .ml small { font-family: var(--sc); font-size: 12px; letter-spacing: .07em; color: var(--ink2); white-space: nowrap; }
.can .here { position: absolute; left: -20px; right: -20px; top: 100%; margin-top: 6px; font-family: var(--sc); font-size: 12px; letter-spacing: .12em; white-space: nowrap; }
/* Open, the cans that are not joined to the picked one step out. */
.can.away { opacity: 0; visibility: hidden; }
.stage.moving .can { transition: transform .5s cubic-bezier(.3, .7, .2, 1), opacity .25s, visibility 0s .25s; }
.stage.moving .can:not(.away) { transition-delay: 0s, .15s, 0s; }
.stage.moving .cable, .fig.inking .cable { stroke-dasharray: 1 2; animation: draw-line .42s .4s both; }
.stage.moving .draw .dot, .fig.inking .draw .dot { animation: fade-in .2s .42s both; }
.fig.inking .can .o { stroke-dasharray: 1 2; animation: draw-line .6s calc(var(--i, 0) * .08s) both; }
.fig.inking .can .fine, .fig.inking .can .here { animation: fade-in .6s .25s both; }
@keyframes draw-line { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

/* What is inside the picked environment: the right half, or under the drawing where there is no room beside it. */
.inside { grid-area: 1 / 2; position: relative; z-index: 2; margin: 8px 4px 10px 0; padding: 0 4px 2px 18px; border-left: 1px solid var(--rule); font-size: 13.5px; line-height: 1.55; animation: inside-in .4s .16s both; }
#plate.stacked .inside { grid-area: 2 / 1 / 3 / 3; margin: 2px 6px 8px; padding: 10px 2px 2px; border-left: 0; border-top: 1px dotted var(--ink3); }
@keyframes inside-in { from { opacity: 0; transform: translateX(10px); } }
.inside header { display: flex; align-items: baseline; gap: 12px; }
.inside header strong { font-size: 17px; font-weight: 600; letter-spacing: .03em; }
.inside header .here { font-family: var(--sc); font-size: 12px; letter-spacing: .12em; white-space: nowrap; }
.inside header .linkbtn { margin-left: auto; font-size: 13px; white-space: nowrap; }
.inside p { margin: 3px 0 9px; color: var(--ink2); }
.inside dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; margin: 0; }
.inside dt { padding-top: 1.5px; font-family: var(--sc); font-size: 12.5px; letter-spacing: .16em; color: var(--ink2); white-space: nowrap; }
.inside dd { margin: 0; min-width: 0; }
.inside code { font-size: 12px; overflow-wrap: anywhere; }
.inside .project-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; border-bottom: 1px solid var(--rule); margin-bottom: 3px; }
.inside .project + dt, .inside .project ~ .project { margin-top: 5px; }
.inside .rel { color: var(--ink2); }
.inside .to + .to { margin-top: 5px; }
.inside .to .linkbtn { font-family: inherit; font-size: inherit; letter-spacing: 0; }
.svc { display: flex; align-items: baseline; gap: 9px; width: 100%; padding: 1px 0; border: 0; background: none; text-align: left; }
.svc svg { flex: none; align-self: center; }
.svc b { flex: none; font-weight: 500; }
.svc[aria-pressed="true"] b { font-weight: 700; }
.svc code { min-width: 0; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.svc .rel { flex: none; font-size: 12px; }
@media (hover: hover) { .svc:hover b { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; } }
.svc:focus-visible { outline: 1px dashed var(--ink); outline-offset: 2px; }

/* ── Page three: the workspace ─────────────────────────────────── */
.left.work { padding-top: clamp(14px, 2.4vh, 26px); overflow: hidden; }
.left.work .machine { flex: 1 1 0; }
.left.work .yard { flex-grow: 0; }
.files { display: grid; grid-template-columns: minmax(150px, 30%) minmax(0, 1fr); height: 100%; min-height: 0; }
.files .side { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding-right: 10px; border-right: 1px solid var(--rule); }
.files .seg { flex: none; gap: 16px; padding: 0 4px 6px; }
.files .seg button { font-size: 13.5px; }
.files .seg .n { margin-left: 5px; font-family: var(--mono); font-size: 11px; letter-spacing: 0; }
.find { flex: none; margin: 0 4px 6px; padding: 2px 0 3px; border: 0; border-bottom: 1px solid var(--rule); background: none; font-size: 13.5px; outline: none; }
.find:focus { border-bottom-color: var(--ink); }
.find::placeholder { color: var(--ink3); font-style: italic; }
.tree { flex: 1; min-height: 0; overflow: auto; font-size: 13.5px; line-height: 1.45; scrollbar-width: thin; }
.tree .root { padding: 2px 4px 3px; font-family: var(--mono); font-size: 11.5px; color: var(--ink3); }
/* margin: a file's row has the class .file, which is also the proposal page's diff block (studio.css) and its bottom margin. */
.tree button { display: flex; align-items: baseline; gap: 5px; width: 100%; margin: 0; padding: 1.5px 6px 1.5px calc(4px + var(--depth, 0) * 13px); border: 0; background: none; text-align: left; white-space: nowrap; }
.tree button:hover { background: var(--wash); }
.tree .tw { flex: none; width: 9px; font-size: 9px; color: var(--ink2); }
.tree .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tree .dir .nm { font-weight: 500; }
.tree .dot .nm { color: var(--ink2); }
.tree .st { flex: none; font-family: var(--sc); font-size: 11px; letter-spacing: .06em; color: var(--ink2); }
.tree .on { background: var(--wash); box-shadow: inset 2px 0 var(--ink); }
.tree .path { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; direction: rtl; text-align: left; }
.tree .note { padding: 4px; font-size: 13px; color: var(--ink2); }
.tree .delta { flex: none; font-family: var(--mono); font-size: 11px; color: var(--ink2); }

.viewer { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ftabs { flex: none; display: flex; align-items: stretch; min-height: 25px; overflow-x: auto; border-bottom: 1px solid var(--rule); scrollbar-width: none; }
.ftabs::-webkit-scrollbar { display: none; }
.ftab { flex: none; display: flex; align-items: baseline; gap: 3px; max-width: 220px; padding: 0 4px 5px 11px; border-right: 1px dotted var(--rule); color: var(--ink2); }
.ftab .nm { min-width: 0; padding: 0; border: 0; background: none; font-family: var(--mono); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ftab .x { flex: none; padding: 0 4px; border: 0; background: none; color: var(--ink3); font-size: 13px; line-height: 1; }
.ftab .x:hover { color: var(--ink); }
.ftab.on { color: var(--ink); box-shadow: inset 0 -1.5px var(--ink); }
.fbar { flex: none; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 5px 4px 5px 11px; font-size: 12.5px; color: var(--ink2); }
.fbar .where { min-width: 0; font-family: var(--mono); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; direction: rtl; text-align: left; }
.fbar .seg { flex: none; gap: 12px; }
.fbar .seg button { font-size: 12.5px; }
.pane { flex: 1; min-height: 0; overflow: auto; scrollbar-width: thin; }
.pane.note { display: grid; place-content: center; justify-items: center; gap: 8px; padding: 20px; color: var(--ink3); font-size: 14px; text-align: center; }
.pane.note::before { content: "❦"; font-size: 20px; }
.code { min-width: max-content; padding-bottom: 12px; font-family: var(--mono); font-size: 12.5px; line-height: 1.62; }
.code .l { display: flex; }
.code .no { position: sticky; left: 0; z-index: 1; flex: none; width: 4.6ch; padding: 0 1.1ch 0 0; border: 0; background: var(--bg); font: inherit; color: var(--ink3); text-align: right; user-select: none; }
.code .no:hover { color: var(--ink); }
.code .tx { flex: 1; padding: 0 16px 0 10px; white-space: pre; tab-size: 2; }
.code .l.sel .tx { background: var(--wash); }
.code .l.sel .no { color: var(--ink); box-shadow: inset 2px 0 var(--ink); }
/* Syntax in ink: weight and slope, never hue. */
.code .c { font-style: italic; color: var(--ink3); }
.code .s { color: var(--ink2); }
.code .k { font-weight: 500; }
.code .hunk .tx { font-style: italic; color: var(--ink3); }
.code .add .tx { font-weight: 500; }
.code .add .no, .code .del .no { color: var(--ink); }
.code .del .tx { color: var(--ink3); text-decoration: line-through; text-decoration-color: var(--ink3); }
.pane .md { max-width: 44em; padding: 6px 18px 20px 14px; font-size: 15px; line-height: 1.7; }
.pane .md h4 { margin: 14px 0 6px; font-family: var(--sc); font-size: 16px; letter-spacing: .08em; }
.pane .md p { margin: 0 0 9px; }
.pane .md ul, .pane .md ol { margin: 0 0 9px; padding-left: 1.4em; }
.pane .md pre { margin: 6px 0 10px; padding: 8px 10px; border-left: 1px solid var(--rule); background: var(--wash); overflow-x: auto; }
.pane .md a { color: inherit; text-underline-offset: 3px; }
.pane .md table { border-collapse: collapse; margin: 4px 0 10px; font-size: 13.5px; }
.pane .md th, .pane .md td { border-bottom: 1px dotted var(--ink3); padding: 3px 12px 3px 0; text-align: left; }
.pane img { display: block; max-width: calc(100% - 28px); margin: 14px auto; border: 1px solid var(--rule); background: var(--sheet); }
.pane iframe { display: block; width: 100%; height: 100%; border: 0; background: var(--sheet); }

/* ── Page four: the account's browser ──────────────────────────
   The tabs reuse the file tabs. The browser's window keeps its own size; its
   picture is as large as the view lets it be, at the top, on the paper. */
.browser { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.browser .ftab { max-width: 200px; }
.browser .ftab .nm { font-family: inherit; font-size: 13px; }
.newtab { flex: none; align-self: center; padding: 0 8px 4px; border: 0; background: none; color: var(--ink3); }
.newtab:hover { color: var(--ink); }
:is(.newtab, .bbar) svg { display: block; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.bbar { flex: none; display: flex; align-items: center; gap: 2px; padding: 5px 4px 6px 4px; }
.bbar .nav { flex: none; padding: 3px 5px; border: 0; background: none; color: var(--ink2); }
.bbar .nav:hover { color: var(--ink); }
.bbar .nav:disabled { color: var(--ink3); cursor: default; }
.addr { flex: 1; min-width: 0; margin-left: 8px; padding: 2px 0 3px; border: 0; border-bottom: 1px solid var(--rule); background: none; font-family: var(--mono); font-size: 12px; outline: none; }
.addr:focus { border-bottom-color: var(--ink); }
.addr::placeholder { color: var(--ink3); font-style: italic; }
.view { position: relative; flex: 1; min-height: 0; display: flex; justify-content: center; align-items: flex-start; padding: 1px; overflow: hidden; }
.shot { display: block; max-width: 100%; max-height: 100%; outline: 1px solid var(--rule); background: var(--sheet); user-select: none; touch-action: none; }
.view.typing .shot { outline-color: var(--ink); }
.keys { position: absolute; left: 0; top: 0; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; resize: none; pointer-events: none; }
.view .note { position: absolute; inset: 0; background: var(--bg); }
.view .note.over { inset: 0 0 auto; display: block; padding: 6px 10px; border-bottom: 1px solid var(--rule); color: var(--ink2); font-size: 13px; text-align: left; }
.view .note.over::before { content: none; }

/* Turning a page: the old one leaves toward the spine, the new one arrives. */
::view-transition-group(*) { animation-duration: .46s; animation-timing-function: cubic-bezier(.3, .7, .2, 1); }
::view-transition-old(screen), ::view-transition-new(screen) { animation-duration: .3s; height: 100%; object-fit: none; object-position: top left; overflow: clip; }
:root[data-shift="fwd"]::view-transition-old(screen) { animation-name: leaf-out-left; }
:root[data-shift="fwd"]::view-transition-new(screen) { animation-name: leaf-in-right; }
:root[data-shift="back"]::view-transition-old(screen) { animation-name: leaf-out-right; }
:root[data-shift="back"]::view-transition-new(screen) { animation-name: leaf-in-left; }
@keyframes leaf-out-left { to { opacity: 0; transform: translateX(-16px); } }
@keyframes leaf-in-right { from { opacity: 0; transform: translateX(16px); } }
@keyframes leaf-out-right { to { opacity: 0; transform: translateX(16px); } }
@keyframes leaf-in-left { from { opacity: 0; transform: translateX(-16px); } }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .2s; }

@media (max-width: 900px) {
  .files { grid-template-columns: minmax(0, 1fr); }
  .files .side { padding: 0; border: 0; }
  .files.reading .side { display: none; }
  .files:not(.reading) .viewer { display: none; }
  .back { display: inline; }
}
@media (min-width: 901px) { .back { display: none; } }
@media (max-width: 560px) {
  .link { grid-template-columns: minmax(0, 1fr) 30px minmax(0, 1fr); gap: 4px; }
  .link svg { width: 30px; }
  .m .ml { padding-inline: 3px; }
  .m .ml b { font-size: 13px; }
  .page { letter-spacing: .1em; }
}
@media (prefers-reduced-motion: reduce) {
  .arr, .mf .o, .mf .d, .can .o { transition: none; }
  .fig.inking * { animation: none !important; }
  /* Without motion a picked can is simply in its new place, with its lines and its card. */
  .stage.moving .can { transition: none; }
  .stage.moving .cable, .stage.moving .draw .dot, .inside { animation: none; }
  .machine[data-busy] .lamp-led circle { animation: none; }
}
