/* 暗房曝光记录卡 · design tokens
   Tones come only from the eleven-step zone ramp. Magenta is filtration: it marks what is ON
   or chosen, nothing else. State grammar: dotted outline = waiting, deepest zone = selected,
   struck rule = unavailable, hatch = work in progress (density is load), crosshatch = failed. */
:root {
  --z0: #0e0e0d; --z1: #1d1d1b; --z2: #2f2f2c; --z3: #45453f; --z4: #5b5a54; --z5: #7a7972;
  --z6: #98978f; --z7: #b7b6ae; --z8: #d3d2cb; --z9: #e8e7e1; --z10: #f7f6f1;
  --mag: #d3137a;
  --tape: rgba(234, 226, 204, .82);
  --tape-edge: rgba(180, 172, 146, .45);
  --cond: "Barlow Condensed", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Noto Sans CJK SC", sans-serif;
  --mono: "Red Hat Mono", ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Noto Sans CJK SC", system-ui, sans-serif;
  --hatch: repeating-linear-gradient(135deg, var(--z5) 0 1px, transparent 1px 4px);
  --hatch-on: repeating-linear-gradient(135deg, var(--mag) 0 1.5px, transparent 1.5px 3.5px);
  --cross: repeating-linear-gradient(45deg, var(--z1) 0 1px, transparent 1px 6px), repeating-linear-gradient(135deg, var(--z1) 0 1px, transparent 1px 6px);
  --gutter: 14px;
  --tab-h: 56px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --settle: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}

/* ---- base ------------------------------------------------------------------ */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--z9); }
body {
  margin: 0; min-height: 100dvh; background: var(--z9); color: var(--z1);
  font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
::selection { background: var(--z1); color: var(--z10); }
:focus-visible { outline: 2px solid var(--mag); outline-offset: 2px; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
a { color: inherit; }
[hidden] { display: none !important; }
* { scrollbar-width: thin; scrollbar-color: var(--z6) transparent; }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-thumb { background: var(--z7); }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.nowrap { white-space: nowrap; }

/* ---- frame: wedge, view, tab bar ------------------------------------------- */
#app { min-height: 100dvh; }
.wedge { display: grid; grid-template-columns: repeat(11, 1fr); height: 8px; position: sticky; top: 0; z-index: 40; }
.wedge i:nth-child(1) { background: var(--z0); } .wedge i:nth-child(2) { background: var(--z1); } .wedge i:nth-child(3) { background: var(--z2); }
.wedge i:nth-child(4) { background: var(--z3); } .wedge i:nth-child(5) { background: var(--z4); } .wedge i:nth-child(6) { background: var(--z5); }
.wedge i:nth-child(7) { background: var(--z6); } .wedge i:nth-child(8) { background: var(--z7); } .wedge i:nth-child(9) { background: var(--z8); }
.wedge i:nth-child(10) { background: var(--z9); } .wedge i:nth-child(11) { background: var(--z10); }
body { padding-top: env(safe-area-inset-top); }

#view { max-width: 560px; margin: 0 auto; padding: 12px var(--gutter) calc(var(--tab-h) + env(safe-area-inset-bottom) + 28px); }
body.task #view { padding-bottom: calc(124px + env(safe-area-inset-bottom)); }
/* Sheets are dealt onto the table one after another. The action bar is left out and the fill is
   backwards only: a transform still in effect would make the sheet the containing block of the
   fixed bar and drag it off the bottom of the screen. */
.page > :not(.go) { animation: sheet-in .42s var(--settle) backwards; }
.page > :nth-child(2):not(.go) { animation-delay: .05s; }
.page > :nth-child(3):not(.go) { animation-delay: .1s; }
.page > :nth-child(n+4):not(.go) { animation-delay: .15s; }
@keyframes sheet-in { from { transform: translateX(26px) rotate(.5deg); opacity: 0; } to { transform: none; opacity: 1; } }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--z10); border-top: 2px solid var(--z1);
  padding-bottom: env(safe-area-inset-bottom);
}
body.task .tabbar { display: none; }
.tabbar .tabs { display: grid; grid-template-columns: repeat(3, 1fr); max-width: 560px; margin: 0 auto; height: var(--tab-h); }
.tabbar a {
  display: flex; align-items: center; justify-content: center; gap: 7px; text-decoration: none;
  font-size: 15px; font-weight: 600; color: var(--z3); border-right: 1px solid var(--z8); position: relative;
}
.tabbar a:last-child { border-right: 0; }
.tabbar a.on { background: var(--z0); color: var(--z10); }
.tabbar a .n { font: 500 12px/1 var(--mono); padding: 3px 5px; background: var(--mag); color: var(--z10); }
.rail-head, .rail-foot { display: none; }

/* ---- the record sheet ------------------------------------------------------ */
.sheet {
  position: relative; background: var(--z10); border: 1px solid var(--z7);
  box-shadow: 0 1px 0 var(--z8), 0 14px 30px rgba(14, 14, 13, .08);
}
.sheet + .sheet { margin-top: 14px; }

.rec-head {
  display: grid; grid-template-columns: auto 1fr auto; align-items: end; gap: 10px;
  padding: 12px 14px 10px; border-bottom: 2px solid var(--z1);
}
.rec-head.plain { grid-template-columns: 1fr auto; }
.rec-head h1 { margin: 0; font: 700 26px/1 var(--cond); letter-spacing: .02em; }
.rec-head h1 small { font: 600 15px/1 var(--cond); color: var(--z4); margin-left: 8px; letter-spacing: .04em; }
.rec-head .no { font: 500 11.5px/1.35 var(--mono); color: var(--z4); text-align: right; }
.sq-btn {
  width: 32px; height: 32px; border: 1px solid var(--z1); background: transparent; color: var(--z1);
  display: grid; place-items: center; padding: 0;
}
.sq-btn:active { background: var(--z9); }

/* label | value ruled rows */
.field { display: grid; grid-template-columns: 58px 1fr; border-bottom: 1px solid var(--z8); }
.field:last-child { border-bottom: 0; }
.field > .k {
  padding: 12px 0 10px 14px; border-right: 1px solid var(--z8);
  font-size: 13px; font-weight: 600; letter-spacing: .12em; color: var(--z4);
}
.field > .v { padding: 10px 14px; min-width: 0; }
.field.req > .k::after { content: "＊"; color: var(--z1); letter-spacing: 0; margin-left: 1px; }
.field.wide { grid-template-columns: 84px 1fr; }
.field.wide > .k { letter-spacing: .06em; }
.note { margin: 0; font-size: 12.5px; color: var(--z4); }
.note + .note { margin-top: 4px; }

/* ---- prints taped to the card ---------------------------------------------- */
.prints { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 14px; padding: 18px 14px 12px; }
.prints.one { grid-template-columns: minmax(0, 1fr); padding-inline: 18%; }
.print { position: relative; margin: 0; padding: 6px 6px 24px; background: #fff; border: 1px solid var(--z8); box-shadow: 0 2px 7px rgba(14, 14, 13, .12); }
.print::before {
  content: ""; position: absolute; z-index: 2; top: -9px; left: 50%; width: 56px; height: 18px; margin-left: -28px;
  background: var(--tape); border: 1px solid var(--tape-edge); transform: rotate(-3deg);
}
.print:nth-child(2)::before { transform: rotate(4deg); }
.print .img { position: relative; aspect-ratio: 3 / 4; background: var(--z9); overflow: hidden; }
.print .img img { width: 100%; height: 100%; object-fit: cover; }
.print figcaption { position: absolute; left: 7px; right: 7px; bottom: 5px; display: flex; justify-content: space-between; gap: 6px; font: 500 11px/1.2 var(--mono); color: var(--z4); }
.print figcaption b { font-family: var(--sans); font-weight: 600; color: var(--z2); }
.print .x {
  position: absolute; z-index: 3; top: 12px; right: 12px; width: 30px; height: 30px; border: 1px solid var(--z1);
  background: rgba(247, 246, 241, .92); display: grid; place-items: center; color: var(--z1); padding: 0;
}
/* an empty print: dotted outline means "waiting for you" */
.print.empty { border: 1.5px dashed var(--z6); box-shadow: none; background: transparent; }
.print.empty::before { display: none; }
.print.empty .img { background: transparent; display: grid; place-items: center; text-align: center; }
.print .pick { position: absolute; inset: 0; border: 0; background: transparent; display: grid; place-content: center; justify-items: center; gap: 8px; color: var(--z3); }
.print .pick b { font-size: 15px; color: var(--z1); }
.print .pick span { font-size: 13px; color: var(--z4); }
/* the second way in, along the foot of an empty print: an earlier result instead of the photo library */
.print .pick.with-rec { bottom: 40px; }
.print .pick-rec {
  position: absolute; left: 0; right: 0; bottom: 0; height: 40px; padding: 0; border: 0; border-top: 1px dashed var(--z7);
  background: transparent; display: flex; align-items: center; justify-content: center; gap: 3px; font-size: 13px; color: var(--z2);
}
.print .pick-rec svg { color: var(--z4); }
.future { display: none; }
.print .up { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: var(--hatch-on); clip-path: inset(0 100% 0 0); transition: clip-path .2s linear; }

/* ---- inputs ------------------------------------------------------------------ */
textarea.lined {
  display: block; width: 100%; border: 0; resize: vertical; min-height: 78px; padding: 0; outline: none;
  font: 15px/26px var(--sans); color: var(--z1);
  background: repeating-linear-gradient(transparent 0 25px, var(--z8) 25px 26px);
}
textarea.lined::placeholder, input::placeholder { color: var(--z5); }
.inline-input { width: 100%; border: 0; border-bottom: 1px solid var(--z7); padding: 6px 0; outline: none; background: transparent; font: 500 15px var(--mono); }
.inline-input:focus, textarea.lined:focus { border-color: var(--z1); }
.text-link { border: 0; background: none; padding: 0; font-size: 13px; color: var(--z2); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* ---- specs: tick one; the hatch length is the time it takes -------------------- */
.spec {
  display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 4px 10px; width: 100%;
  padding: 10px 0; border: 0; border-bottom: 1px dashed var(--z8); background: none; text-align: left; color: inherit;
}
.spec:last-child { border-bottom: 0; }
.box { width: 17px; height: 17px; border: 1.5px solid var(--z1); display: grid; place-items: center; flex: none; background: var(--z10); }
.on > .box, .box.on { background: var(--mag); border-color: var(--mag); }
.on > .box::after, .box.on::after { content: ""; width: 9px; height: 9px; background: var(--z10); clip-path: polygon(14% 44%, 0 59%, 40% 100%, 100% 22%, 86% 8%, 40% 70%); }
.spec b { font-size: 16px; font-weight: 600; }
.spec b small { font-size: 12.5px; font-weight: 400; color: var(--z4); margin-left: 7px; }
.spec .t { font: 500 14px/1 var(--mono); }
.spec .bar { grid-column: 2 / 4; height: 7px; background: var(--hatch); min-width: 4px; max-width: 100%; }
.spec.on .bar { background: var(--hatch-on); }
.spec .size { grid-column: 2 / 4; font: 11.5px/1 var(--mono); color: var(--z4); margin-top: -1px; }
.spec[disabled] { cursor: not-allowed; }
.spec[disabled] b, .spec[disabled] .t { text-decoration: line-through; text-decoration-thickness: 1.5px; color: var(--z5); }
.spec[disabled] .bar { background: none; border-top: 1px solid var(--z7); height: 1px; margin-top: 3px; }
.spec .why { grid-column: 2 / 4; font-size: 13px; color: var(--z3); }

.flag { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--z8); cursor: pointer; }
.flag:last-child { border-bottom: 0; }
.flag input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.flag span.l { flex: 1; font-size: 15px; }
.flag em { font: normal 500 13px var(--mono); color: var(--z3); }
.flag input:focus-visible + .box { outline: 2px solid var(--mag); outline-offset: 2px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--z1); background: var(--z10); color: var(--z1); padding: 6px 10px; line-height: 1.2;
  font-size: 14px; display: inline-flex; align-items: center; gap: 7px;
}
.chip.on { background: var(--z0); color: var(--z10); border-color: var(--z0); }
.chip .shape { display: inline-block; border: 1.5px solid currentColor; }
.chip .c { font: 500 11.5px var(--mono); opacity: .75; }

details.more > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 11px 14px; font-size: 13px; font-weight: 600; letter-spacing: .12em; color: var(--z4); }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary .mono { letter-spacing: 0; font-weight: 500; }
details.more > summary svg { transition: transform .25s var(--ease); }
details.more[open] > summary svg { transform: rotate(180deg); }
details.more .inside { padding: 0 14px 14px; display: grid; gap: 12px; }
.pair-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pair-inputs label { font-size: 12.5px; color: var(--z4); }

/* ---- primary bar ------------------------------------------------------------- */
.go {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  background: var(--z9); border-top: 1px solid var(--z7);
  animation: rise .34s var(--settle) .08s backwards;
}
.go .inner { max-width: 532px; margin: 0 auto; display: grid; grid-template-columns: 1fr auto; }
.go .start {
  height: 54px; border: 0; background: var(--z0); color: var(--z10); padding: 0 16px; text-align: left;
  font-size: 18px; font-weight: 700; letter-spacing: .06em; display: flex; align-items: center; gap: 10px;
}
/* unavailable is a struck rule, as on the spec rows: the bar goes to paper and its verb is crossed out */
.go .start:disabled { background: var(--z10); color: var(--z5); box-shadow: inset 0 0 0 1px var(--z7); cursor: not-allowed; }
.go .start:disabled .l { text-decoration: line-through; text-decoration-thickness: 2px; }
.go .eta { display: grid; align-content: center; justify-items: end; min-width: 104px; padding: 0 14px; background: var(--mag); color: var(--z10); }
.go .start:disabled + .eta { background: var(--z8); color: var(--z4); }
.go .eta small { font-size: 11px; letter-spacing: .12em; opacity: .9; }
.go .eta b { font: 600 19px/1.15 var(--mono); }
.go .say { grid-column: 1 / 3; margin: 6px 0 0; font-size: 12.5px; color: var(--z3); min-height: 1.2em; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--z1); background: var(--z10); color: var(--z1); font-size: 15px; font-weight: 600; text-decoration: none;
}
.btn:active { background: var(--z9); }
.btn.solid { background: var(--z0); color: var(--z10); border-color: var(--z0); }
.btn.solid:active { background: var(--z2); }
.btn.quiet { border-color: var(--z7); color: var(--z3); }
/* a button waiting on its own action is work in progress: it takes the hatch, not a faded wash */
.btn[disabled] { background: var(--hatch); background-color: var(--z10); color: var(--z4); border-color: var(--z6); pointer-events: none; }
.btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.btns.two { grid-template-columns: 1fr 1fr; }
.save {
  display: grid; grid-template-columns: 1fr auto; width: 100%; border: 0; padding: 0; background: none; text-align: left;
}
.save > span:first-child { display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 16px; background: var(--z0); color: var(--z10); font-size: 18px; font-weight: 700; letter-spacing: .06em; }
.save > span:last-child { display: grid; place-items: center; padding: 0 14px; background: var(--z3); color: var(--z10); font: 600 13px var(--mono); }

/* ---- home: the print on the table, then the four processes ------------------------ */
.bench-box { border-bottom: 2px solid var(--z1); }
.bench { display: grid; grid-template-columns: minmax(0, 42%) minmax(0, 1fr); gap: 16px; align-items: end; padding: 22px 14px 16px; text-decoration: none; color: inherit; }
.bench .print .img img.ghost { filter: grayscale(1) contrast(.55) brightness(1.35); opacity: .55; }
.bench .print .img .clear { position: absolute; inset: 0; background: var(--hatch); transition: opacity 1s linear; }
.bench .print.empty .pick { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; padding: 8px; text-align: center; }
.bench .meta { display: grid; gap: 4px; min-width: 0; padding-bottom: 24px; }
.bench .nm { display: flex; align-items: baseline; gap: 8px; }
.bench .nm b { font-size: 18px; font-weight: 700; }
.bench .nm span { font-size: 12.5px; color: var(--z4); }
.bench .st { font-size: 13px; color: var(--z2); }
.bench .time { font: 600 34px/1.05 var(--mono); letter-spacing: -.02em; margin-top: 6px; }
.bench .sub { font: 500 12.5px var(--mono); color: var(--z4); }
.bench .load { margin-top: 6px; }
.bench .open { display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; font-size: 13px; color: var(--z2); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.bench:active .print { transform: rotate(-.6deg); }

.proc {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 14px; align-items: baseline; gap: 1px 10px;
  padding: 12px 14px 13px; border-bottom: 1px dashed var(--z8); text-decoration: none; color: inherit;
}
.proc:last-child { border-bottom: 0; }
.proc:active { background: var(--z9); }
.proc b { font-size: 18px; font-weight: 700; letter-spacing: .02em; }
.proc .t { font: 500 14px/1 var(--mono); color: var(--z1); }
.proc .t small { font: 400 12px var(--sans); color: var(--z4); }
.proc svg { grid-column: 3; grid-row: 1 / 3; align-self: center; color: var(--z4); }
.proc .d { grid-column: 1 / 3; font-size: 13px; color: var(--z4); }
.proc .bar { grid-column: 1 / 3; height: 7px; margin-top: 7px; background: var(--hatch); min-width: 4px; }
.proc.missing b { text-decoration: line-through; text-decoration-thickness: 1.5px; color: var(--z5); }
.proc.missing .d { color: var(--z2); }

.sec-head { display: flex; align-items: baseline; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--z1); }
.sec-head h2 { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .14em; }
.sec-head a, .sec-head .aside { font-size: 13px; color: var(--z3); }
.empty-line { padding: 18px 14px; font-size: 13.5px; color: var(--z4); }

.running { display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--z8); text-decoration: none; color: inherit; }
.running:last-child { border-bottom: 0; }
.running .thumb { width: 52px; height: 64px; background: var(--z9); position: relative; overflow: hidden; border: 1px solid var(--z8); }
.running .thumb img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(.8) brightness(1.1); }
.running .thumb::after { content: ""; position: absolute; inset: 0; background: var(--hatch); opacity: .7; }
.running .top { display: flex; justify-content: space-between; gap: 8px; font-size: 15px; font-weight: 600; }
.running .top .mono { font-size: 12.5px; font-weight: 500; color: var(--z3); }
.running .st { font-size: 13px; color: var(--z3); margin: 2px 0 7px; }

.load { height: 8px; border: 1px solid var(--z7); background: var(--z10); position: relative; overflow: hidden; }
.load > i { position: absolute; inset: 0; background: var(--hatch-on); clip-path: inset(0 100% 0 0); transition: clip-path .8s var(--ease); }
.load.wait > i { background: none; }
.load.wait { border-style: dashed; }

/* ---- contact sheet (history) --------------------------------------------------- */
.contact { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 8px; padding: 12px; }
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: 96px; gap: 8px; overflow-x: auto; padding: 12px 14px 14px; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.frame { display: block; position: relative; text-decoration: none; color: inherit; min-width: 0; }
/* the frame still developing is the current print, so it carries tape like every current print */
.frame.run::before { content: ""; position: absolute; z-index: 2; top: -7px; left: 50%; width: 40px; height: 13px; margin-left: -20px; background: var(--tape); border: 1px solid var(--tape-edge); transform: rotate(-3deg); }
.frame .pic .veil i { font: normal 500 11px var(--mono); color: var(--z3); }
.frame .pic { position: relative; aspect-ratio: 3 / 4; background: var(--z9); border: 1px solid var(--z1); padding: 3px; overflow: hidden; }
.frame .pic img { width: 100%; height: 100%; object-fit: cover; }
.frame .pic .veil { position: absolute; inset: 3px; display: grid; place-items: center; text-align: center; font-size: 13px; font-weight: 600; }
.frame.run .pic .veil { background: var(--hatch); background-color: rgba(247, 246, 241, .55); }
.frame.run .pic .veil span, .frame.err .pic .veil span, .frame.off .pic .veil span { background: var(--z10); padding: 2px 6px; border: 1px solid var(--z1); }
.frame.err .pic .veil { background: var(--cross); background-color: rgba(247, 246, 241, .6); }
.frame.off .pic { border-style: dashed; }
.frame.off .pic img { opacity: .45; filter: grayscale(1); }
.frame .cap { display: flex; justify-content: space-between; gap: 4px; margin-top: 5px; font: 500 11px/1.25 var(--mono); color: var(--z3); }
.frame .cap b { font-family: var(--sans); font-weight: 600; color: var(--z1); font-size: 13px; }
.frame .cap.no { margin-top: 1px; color: var(--z4); }
.legend { display: flex; gap: 6px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--z8); }
.more-row { padding: 4px 14px 16px; text-align: center; }
/* 选择: the contact sheet as a selection. A ticked frame gets the magenta box and a heavier ink frame. */
.legend .pick-mode { margin-left: auto; }
.frame.picking { cursor: pointer; -webkit-user-select: none; user-select: none; }
.frame .tick { position: absolute; z-index: 3; top: 7px; left: 7px; box-shadow: 0 1px 3px rgba(14, 14, 13, .25); }
.frame.sel .pic { outline: 2px solid var(--z0); outline-offset: -1px; }
.go.batch .inner { grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
.go.batch .count { display: grid; justify-items: start; gap: 2px; font-size: 15px; }
.go.batch .count b { font: 600 17px var(--mono); }
.go.batch .count .note { display: inline; }
.go.batch .btn { min-width: 76px; }
/* nothing chosen: the action is unavailable, a struck rule; the hatch stays for work in progress */
.go.batch .btn[disabled]:not(.busy) { background: var(--z10); color: var(--z5); border-color: var(--z7); text-decoration: line-through; text-decoration-thickness: 1.5px; }

/* ---- job: developing print, process log ------------------------------------------ */
.dev { position: relative; margin: 18px 14px 6px; padding: 8px 8px 30px; background: #fff; border: 1px solid var(--z8); box-shadow: 0 3px 10px rgba(14, 14, 13, .12); }
.dev::before { content: ""; position: absolute; z-index: 3; top: -9px; left: 50%; width: 64px; height: 18px; margin-left: -32px; background: var(--tape); border: 1px solid var(--tape-edge); transform: rotate(-2deg); }
.dev .img { position: relative; aspect-ratio: 3 / 4; overflow: hidden; background: var(--z9); }
.dev .img img { width: 100%; height: 100%; object-fit: cover; }
.dev .ghost { filter: grayscale(1) contrast(.55) brightness(1.35); opacity: .5; }
.dev .clear { position: absolute; inset: 0; background: var(--hatch); background-size: 100% 100%; transition: opacity 1s linear; }
.dev .stamp { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: var(--z10); border: 1px solid var(--z1); padding: 8px 12px; text-align: center; }
.dev .stamp b { display: block; font-size: 18px; }
.dev .stamp span { font: 500 12px var(--mono); color: var(--z3); }
.dev figcaption { position: absolute; left: 10px; right: 10px; bottom: 7px; display: flex; justify-content: space-between; font: 500 11.5px var(--mono); color: var(--z4); }
.result.fresh img.main { animation: develop 1.6s var(--ease) both; }
@keyframes develop { from { filter: grayscale(1) brightness(1.6) contrast(.5); opacity: .35; } to { filter: none; opacity: 1; } }

.clock { display: flex; align-items: baseline; justify-content: space-between; padding: 12px 14px 4px; }
.clock b { font: 600 40px/1 var(--mono); letter-spacing: -.02em; }
.clock span { font: 500 13px var(--mono); color: var(--z3); }
.clock + .load { margin: 6px 14px 14px; }

.log { list-style: none; margin: 0; padding: 0; }
.log li { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 10px; padding: 9px 14px; border-top: 1px solid var(--z8); font-size: 15px; }
.log li .mark { width: 15px; height: 15px; border: 1.5px dotted var(--z5); }
.log li.done { color: var(--z3); }
.log li.done .mark { border: 1.5px solid var(--z3); background: var(--z3); }
.log li.now { font-weight: 700; }
.log li.now .mark { border: 1.5px solid var(--mag); background: var(--hatch-on); }
.log li .mono { font-size: 12.5px; color: var(--z3); font-weight: 500; }

.pe { padding: 12px 14px; border-top: 1px solid var(--z8); }
.said .row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; }
.said .row b { font-size: 13px; letter-spacing: .12em; color: var(--z4); }
.said p { margin: 0; white-space: pre-wrap; font-size: 14px; line-height: 1.7; color: var(--z2); }
.said p.clamp { display: -webkit-box; -webkit-line-clamp: 5; line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.said .tools { display: flex; gap: 18px; margin-top: 6px; }
.rec-two.job details.more { border-top: 1px solid var(--z8); }

/* ---- job: result ------------------------------------------------------------------ */
.result { margin: 18px 14px 0; padding: 7px 7px 28px; background: #fff; border: 1px solid var(--z8); box-shadow: 0 3px 12px rgba(14, 14, 13, .14); position: relative; }
/* tape marks the print that is on the card now: the inputs, the one developing, the finished result */
.result::before { content: ""; position: absolute; z-index: 3; top: -9px; left: 50%; width: 64px; height: 18px; margin-left: -32px; background: var(--tape); border: 1px solid var(--tape-edge); transform: rotate(2deg); }
.result .img { position: relative; overflow: hidden; background: var(--z9); }
.result img.main { width: 100%; height: auto; max-height: 72dvh; object-fit: contain; margin: 0 auto; }
.result figcaption { position: absolute; left: 9px; right: 9px; bottom: 7px; display: flex; justify-content: space-between; gap: 8px; font: 500 11.5px var(--mono); color: var(--z4); }
/* the time it took is one more ruled row of the record, written large */
.field.took { border-bottom: 2px solid var(--z1); }
.field.took > .k { padding-top: 18px; }
.field.took > .v { display: grid; gap: 4px; padding-top: 12px; padding-bottom: 12px; }
.field.took b { font: 600 40px/1 var(--mono); letter-spacing: -.02em; }
.variants { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 14px 0; }
.act { padding: 14px; display: grid; gap: 8px; }

.compare { position: relative; overflow: hidden; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.compare img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.compare .before { position: absolute; inset: 0; clip-path: inset(0 50% 0 0); }
.compare .handle { position: absolute; top: 0; bottom: 0; left: 50%; width: 1.5px; background: var(--z10); transform: translateX(-.75px); pointer-events: none; box-shadow: 0 0 0 .5px var(--z1); }
.compare .handle::after { content: ""; position: absolute; top: 50%; left: 50%; width: 22px; height: 22px; transform: translate(-50%, -50%) rotate(45deg); background: var(--z10); border: 1.5px solid var(--z1); }
.compare .tag { position: absolute; top: 8px; font: 500 11px var(--mono); background: var(--z10); border: 1px solid var(--z1); padding: 2px 6px; pointer-events: none; }
.compare .tag.l { left: 8px; } .compare .tag.r { right: 8px; }

.kv { display: grid; grid-template-columns: 58px 1fr; margin: 0; }
.act + .kv, .act + details.more, details.more > .kv, details.more > .kv + .inside { border-top: 1px solid var(--z8); }
details.more > .kv + .inside { padding-top: 12px; }
.kv > :nth-last-child(-n+2) { border-bottom: 0; }
.kv > dt, .kv > dd { padding: 9px 0; border-bottom: 1px solid var(--z8); margin: 0; font-size: 14px; }
.kv > dt { padding-left: 14px; border-right: 1px solid var(--z8); color: var(--z4); font-size: 13px; font-weight: 600; letter-spacing: .12em; }
.kv > dd { padding-left: 14px; padding-right: 14px; min-width: 0; overflow-wrap: anywhere; }
.kv > dd.mono { font-size: 13.5px; }

.fail { margin: 14px; padding: 12px; border: 1px solid var(--z1); background: var(--cross); background-color: var(--z10); }
.fail > div { background: var(--z10); padding: 10px 12px; }
.fail b { display: block; font-size: 16px; margin-bottom: 4px; }
.fail pre { margin: 8px 0 0; font: 12px/1.5 var(--mono); white-space: pre-wrap; color: var(--z3); max-height: 200px; overflow: auto; }

/* ---- settings --------------------------------------------------------------------- */
.led { display: inline-block; width: 11px; height: 11px; border: 1.5px solid var(--z1); vertical-align: -1px; }
.led.ready { background: var(--z1); }
.led.busy { background: var(--mag); border-color: var(--mag); }
.led.off { border-style: dotted; }
.led.bad { background: var(--cross); }
.vram { display: grid; grid-template-columns: repeat(11, 1fr); gap: 2px; height: 10px; margin-top: 6px; }
.vram i { background: var(--z8); }
.vram i.used { background: var(--z2); }
.url { font: 500 14px/1.4 var(--mono); overflow-wrap: anywhere; user-select: all; padding: 8px 10px; border: 1px dashed var(--z6); background: var(--z10); }
.model { display: grid; grid-template-columns: 16px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--z8); }
.model:last-child { border-bottom: 0; }
.model .mk { width: 14px; height: 14px; margin-top: 3px; border: 1.5px solid var(--z1); }
.model.ok .mk { background: var(--z1); }
.model.no .mk { background: var(--cross); }
.model b { font-size: 14px; display: block; }
.model span { font: 12px/1.4 var(--mono); color: var(--z4); overflow-wrap: anywhere; }
.model a { font-size: 12.5px; }
details.models > summary { font-size: 15px; font-weight: 400; letter-spacing: 0; color: var(--z1); padding: 13px 14px; }
details.models > summary .mono { letter-spacing: 0; color: var(--z4); font-size: 12.5px; }
details.models .sum { display: flex; align-items: center; gap: 10px; }
details.models .mk { width: 14px; height: 14px; border: 1.5px solid var(--z1); flex: none; }
details.models .mk.ok { background: var(--z1); }
details.models .mk.no { background: var(--cross); }
details.models > .act { padding-top: 0; }

/* ---- toast, dialog ------------------------------------------------------------------ */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 18px); transform: translateX(-50%);
  z-index: 60; max-width: calc(100% - 32px); padding: 10px 14px; background: var(--z0); color: var(--z10); font-size: 14px;
  box-shadow: 0 8px 20px rgba(14, 14, 13, .25);
}
body.task .toast { bottom: calc(112px + env(safe-area-inset-bottom)); }
dialog.dlg {
  border: 1px solid var(--z1); padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; background: var(--z10); color: var(--z1);
  box-shadow: 0 -10px 30px rgba(14, 14, 13, .18); animation: rise .34s var(--settle);
}
@keyframes rise { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 640px) { dialog.dlg { margin: auto; max-width: 440px; } }
dialog.dlg::backdrop { background: rgba(14, 14, 13, .45); }
dialog.dlg .body { padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
dialog.dlg h3 { margin: 0 0 8px; font-size: 18px; }
dialog.dlg p { margin: 0 0 14px; font-size: 14.5px; color: var(--z2); }
dialog.dlg .btn-col { display: grid; gap: 8px; }
dialog.dlg .check { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 14px; cursor: pointer; }
dialog.dlg .check input { position: absolute; opacity: 0; }
/* 从记录里选: a contact sheet in the dialog; the title and 取消 stay, the frames scroll */
dialog.dlg.records .body { display: flex; flex-direction: column; max-height: min(86dvh, 820px); }
dialog.dlg.records .scroll { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -16px 12px; border-top: 1px solid var(--z8); border-bottom: 1px solid var(--z8); }
dialog.dlg.records .contact { padding: 12px 16px; }
dialog.dlg.records .more-row { padding: 0 16px 14px; }
dialog.dlg.records .empty-line { padding: 18px 0; text-align: left; }
@media (min-width: 640px) { dialog.dlg.records { max-width: 640px; } }
button.frame { width: 100%; padding: 0; border: 0; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
button.frame:focus-visible { outline: 2px solid var(--mag); outline-offset: 3px; }

.spin { display: inline-block; width: 14px; height: 14px; border: 1.5px solid currentColor; border-right-color: transparent; animation: rot .9s linear infinite; vertical-align: -2px; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---- wide screens: binder tabs on the left, two-column records -------------------------- */
@media (min-width: 900px) {
  :root { --gutter: 24px; }
  #app { display: grid; grid-template-columns: 200px minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .wedge { grid-column: 1 / 3; }
  .tabbar { position: sticky; top: 8px; align-self: start; grid-column: 1; grid-row: 2; border-top: 0; border-right: 2px solid var(--z1); background: transparent; height: calc(100dvh - 8px); padding: 0; display: flex; flex-direction: column; }
  body.task .tabbar { display: flex; }
  /* the spine's head rule lines up with the record head's rule on the sheet */
  .rail-head { display: flex; align-items: flex-end; justify-content: space-between; height: 78px; padding: 0 20px 10px; border-bottom: 2px solid var(--z1); }
  .rail-head b { font-size: 26px; line-height: 1; font-weight: 700; letter-spacing: .02em; }
  .rail-head span { font: 500 11.5px var(--mono); color: var(--z4); }
  .rail-foot { display: block; margin-top: auto; padding: 14px 20px 18px; border-top: 1px solid var(--z8); font-size: 13px; color: var(--z3); }
  .tabbar .tabs { grid-template-columns: 1fr; grid-auto-rows: 52px; height: auto; max-width: none; margin: 0; }
  .tabbar a { justify-content: flex-start; padding: 0 20px; border-right: 0; border-bottom: 1px solid var(--z8); }
  #view { grid-column: 2; grid-row: 2; max-width: 1040px; width: 100%; padding: 22px var(--gutter) 60px; margin: 0 auto; }
  /* the bar rests right under the record and sticks to the bottom only when the record is taller than the screen */
  body.task #view { padding-bottom: 40px; }
  .go { position: sticky; bottom: 0; left: auto; right: auto; margin-top: 14px; padding: 10px 0 14px; }
  .go .inner { max-width: none; }
  .rec-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; }
  .rec-two > .left { border-right: 1px solid var(--z8); position: sticky; top: 8px; }
  /* the same rule drawn from the right side too, so it runs the full height of whichever column is taller */
  .rec-two > .left + * { border-left: 1px solid var(--z8); margin-left: -1px; }
  .rec-two.job { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
  .rec-two .left .future { display: block; width: 40%; margin: 6px auto 24px; }
  /* the spine carries the name, the date and the machine's light; the sheets stop repeating them */
  .rec-head .no.today, .rec-head.home-head { display: none; }
  .rec-two.home { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .rec-two.home .bench-box { border-bottom: 0; }
  .rec-two.home .bench { grid-template-columns: minmax(0, 55%) minmax(0, 1fr); padding: 28px 20px 20px; }
  .contact { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px 12px; padding: 16px; }
  .result img.main { max-height: 78vh; }
  .toast, body.task .toast { left: calc(50% + 100px); bottom: 32px; }
  body.task .toast { bottom: 110px; }
}

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