/* The styles of /view-source/ and /view-dom/. Both pages are the same kind of page with a different layer under it. */
/* #region layout */
/* The document does not scroll. The page scrolls inside #sheet, which is as tall as the window below the
   menu bar, so the canvas that draws it is one screen and the corner stays at the top right. */
html, body { height: 100%; overflow: hidden; }
#desk { --desk: calc(100svh - 49px); position: relative; height: var(--desk); overflow: clip; background: #14161b; }
#under { position: absolute; inset: 0; background: #14161b; }
#sheet { height: var(--desk); overflow-y: auto; overscroll-behavior: contain; background: var(--bg); }
/* The shader reads --fx-x and --fx-y from #sheet. They are inherited properties, so without this every
   element of the page would get a new style on every frame of a drag. */
#sheet > * { --fx-x: 0; --fx-y: 0; }
/* #endregion layout */

#sheet { --hue: 28; --ink: oklch(50% 0.17 var(--hue)); --wash: oklch(93% 0.05 var(--hue)); --tint: oklch(86% 0.09 var(--hue)); }
@media (prefers-color-scheme: dark) {
  #sheet { --ink: oklch(80% 0.13 var(--hue)); --wash: oklch(27% 0.05 var(--hue)); --tint: oklch(38% 0.09 var(--hue)); }
}
#sheet main { padding-top: 16px; }
.hero { margin: 0 -16px; padding: 24px 16px 8px; background: linear-gradient(165deg, var(--wash), transparent 78%); display: grid; gap: 0 32px; }
.hero .label { margin: 0 0 10px; font: 600 12px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); }
.hero h1 { font-size: clamp(30px, 6vw, 52px); letter-spacing: -0.03em; line-height: 1.02; text-wrap: balance; padding-right: 44px; }
.hero h1 em { font-style: normal; color: var(--ink); }
.hero .row button { min-height: 40px; }
.hero .row button.main { background: var(--ink); border-color: var(--ink); color: var(--bg); font-weight: 600; }
#peel-status { min-height: 3em; margin: 10px 0 0; }
#route { min-height: 4.4em; font-size: 14px; color: var(--muted); }
@media (min-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr) 340px; }
  .hero .stack { grid-column: 2; grid-row: 1 / span 6; align-self: center; }
}

/* Four layers drawn as tilted cards. */
.stack { margin: 8px 0 0; }
.stack .scene { position: relative; height: 250px; perspective: 1100px; }
.stack .layer { position: absolute; left: 50%; top: 56%; width: 210px; height: 128px; margin: -64px 0 0 -105px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); font-size: 13px; line-height: 1.3; transform: rotateX(58deg) rotateZ(-34deg) translateZ(calc(var(--i) * 36px)); }
.stack .layer b { display: block; }
.stack .layer span { color: var(--muted); }
.stack .l-under { --i: 0; background: #14161b repeating-linear-gradient(#14161b 0 9px, #2a3142 9px 11px); color: #e8ecf5; border-color: #2a3142; }
.stack .l-under b, .stack .l-under span { background: #14161b; color: #e8ecf5; width: max-content; padding-right: 6px; }
.stack .l-page { --i: 1; background: var(--card); }
.stack .l-canvas { --i: 2; background: color-mix(in srgb, var(--tint) 45%, transparent); border: 1.5px dashed var(--ink); }
.stack .l-handle { --i: 3; background: var(--ink); color: var(--bg); border: 0; clip-path: polygon(100% 0, 100% 62%, 46% 0); text-align: right; }
.stack .l-handle span { color: inherit; }
.stack figcaption { font-size: 14px; color: var(--muted); text-align: center; }

.receipt dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px 20px; margin: 0 0 16px; }
.receipt dl > div.wide { grid-column: 1 / -1; }
.receipt dt { font: 600 11px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.receipt dd { margin: 2px 0 0; font-size: 22px; font-weight: 650; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; min-height: 1.5em; overflow-wrap: anywhere; }
.receipt dd.small { font-size: 16px; font-weight: 500; }
.receipt .bars-title { margin: 14px 0 6px; font-size: 14px; font-weight: 600; }
.receipt .bars-title .note { font-weight: 400; margin-left: 6px; }
.receipt .chunks { display: flex; gap: 3px; height: 28px; }
.receipt .chunks span { min-width: 6px; border-radius: 4px; background: var(--ink); color: var(--bg); font: 600 11px/28px var(--mono); text-align: center; overflow: hidden; }
.receipt .batches { display: flex; gap: 2px; align-items: flex-end; height: 56px; border-bottom: 1px solid var(--line); }
.receipt .batches span { flex: 1 1 0; max-width: 18px; background: var(--tint); border-radius: 3px 3px 0 0; }

.changes { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.changes article { background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--ink); border-radius: 12px; padding: 14px 16px; min-width: 0; }
.changes h3 { margin: 0 0 8px; font-size: 16px; }
.changes p { margin: 8px 0; }
.changes .what { font-size: 14px; color: var(--muted); margin-bottom: 0; }
.changes button, .changes input:not([type]) { min-height: 40px; }
.changes input:not([type]) { font: inherit; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); width: 11em; max-width: 100%; }
.changes input[type="checkbox"] { width: 20px; height: 20px; vertical-align: -4px; }
#clock { font: 650 34px/1 var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; color: var(--ink); }
#count-out { display: inline-block; min-width: 2ch; margin-left: 8px; font: 650 22px var(--mono); }
#list { margin: 0 0 8px; padding-left: 22px; min-height: 4.7em; }
#swatches { display: flex; gap: 8px; flex-wrap: wrap; }
#swatches button { width: 40px; height: 40px; padding: 0; border-radius: 50%; background: oklch(62% 0.17 var(--h)); border: 2px solid var(--card); outline: 1px solid var(--line); }
#swatches button[aria-pressed="true"] { outline: 3px solid var(--fg); }
#editable { padding: 8px 10px; border: 1px dashed var(--ink); border-radius: 6px; min-height: 2.6em; }
/* #region nested-style */
/* A canvas inside a drawn element needs contain: paint, or its pixels are drawn shifted in the outer picture. */
#twice { display: block; width: 100%; height: 150px; contain: paint; }
#twice-block { width: 210px; padding: 10px 12px; border-radius: 10px; background: var(--wash); border: 1px solid var(--tint); text-align: center; }
/* #endregion nested-style */
#twice-block b { display: block; margin-bottom: 6px; }

.receipt .row { margin-top: 14px; }
.receipt .row button { min-height: 40px; }
