/* cases.css: ส่วนที่ 6 เส้นเรื่องโครงการเดียว 5 ช่วง (#cases) ของ krobjobsystem.com, layout shell 29 พ.ย. 2569.
   v3 (owner 29 พ.ย. 2569 "ประกอบได้เลย"): stage 4 is assembled from s4-billing/block.html v7 (T3, data-chart="real").
     - Numerals C1 for all 5 stages (from numbering/v1-c.css via s4.css, cs- prefix, rules here once): ghost "01" to "05"
       (IBM Plex Sans Thai 700, clamp(72px, 8cqi, 112px) of the stage list box = 96 px at 1440, 56 px under a 768 px frame,
       navy 16% on --h-bg, aria-hidden) left of the h3 stack; h3 24 -> 28 px with a visually hidden "ช่วงที่ N จาก 5".
       The old small label .cs-label is gone. .cs-stages is now the size container (cs-stg) the numeral measures.
     - .cs-points (lead + short lines, small navy dot) lives here; only stage 4 uses it so far (copy B).
     - Stage 4 picture under the .cs-s4 prefix (renamed, flat selectors: .fan -> .cs-s4, .bill -> .cs-s4-bill, .doc -> .cs-s4-doc,
       .doc-bill/.doc-rcpt -> .cs-s4-doc-bill/.cs-s4-doc-rcpt, .chart -> .cs-s4-chart, .ms -> .cs-s4-ms). Only T3 ships, so its
       numbers are the base rules (t1/t2 dropped); geometry tokens sit on .cs-s4 and resolve in the picture's own cqi.
       Edit stage 4 here and in shell.html; s4-billing/ stays as the design record.
   v4 stage 5 (owner 29 พ.ย. 2569 "ประกอบได้เลย"): s5-handover/block.html v5.7 under the .cs-s5- prefix (renamed flat: .fan -> .cs-s5,
     .pc -> .cs-s5-pc, .pc-k/.pc-s/.pc-a -> .cs-s5-k/.cs-s5-s/.cs-s5-a), 3 real screens on a 640 grid in .cs-s5's own cqi, see its block below.
     Edit stage 5 here and in shell.html; s5-handover/ stays as the design record.
   Loaded by docs/design/cases/shell.html and by docs/design/index.html (assembled there 29 พ.ย. 2569, image src prefixed cases/).
   v7 connector B (owner chose B 29 พ.ย. 2569 from connector/index.html): a serpentine dashed line through the 5 stage numbers, drawn as one
     decorative SVG by cases.js (defer) when the frame has data-cn="b"; styles and --cs-cn-* tokens in the "connector B" block at the end of this file.
     It reads --blue (declared by shell.html and index.html) on top of the tokens listed below.
   Layout E revised by the owner 29 พ.ย. 2569: the step bar sits once under the heading (not sticky), then 5 stage blocks.
   Later on 29 พ.ย. 2569 the owner removed the head (h2, sub, project chip) and the step bar: the section is the 5 stage blocks only, h2 kept visually hidden. Later the same day the
   owner changed the side rule: blocks alternate left/right by what suits each image, NOT mechanically every block, and the image width may differ
   per block. Owner clarification the same day: every block's image width is its own, not a preset, and the text takes what is left.
   Each .cs-stage carries data-art="left|right" (image side from a 1024 px box) and style="--art-w: 640px" (image column width, clamped to
   360 to 820 px, free aspect). Height cap per block: style="--art-h: 600px" (default 520 px, clamped to 360 to 640 px), e.g. stage 4 for its A4 sheets. The text column flexes from 280 px to the rest (its sentence still stops at 34em).
   Image and text are top-aligned. Under 1024 px every block stacks text then image and data-art is ignored.
   No device frames, no gold (this section has no CTA), at most 3 overlapping pieces per stage image.
   Each stage image is its own HTML fragment with its own CSS (built later) pasted inside .cs-art; this file only gives the box its limits.
   Thai text: no text-transform, no letter-spacing. Numbers with their units sit in <span class="nw">.
   Layout uses container queries: put the section inside .cs-frame (container-type: inline-size, name cs), the same job as .ft-frame and .faq-frame,
   so the markup lays out by the width it really gets.
   Colour tokens come from the page's :root block: --navy --white --h-bg --h-ink --h-muted --h-line --font-head --font-body.
   Every px and hex is declared once as a custom property below, so the rules only use var(). */

.cs-frame { container-type: inline-size; container-name: cs; }

/* ds-allow-hardcode:start */
.cs {
  /* surfaces (all text checked on --h-bg #f4f7fc: navy 16.88:1, --h-ink 14.49:1, --h-muted 5.79:1; white on navy 18.13:1, WCAG formula, 29 พ.ย. 2569) */
  --cs-bg: var(--h-bg);
  --cs-ink: var(--h-ink);
  --cs-title: var(--navy);
  --cs-muted: var(--h-muted);
  --cs-line: var(--h-line);
  /* type: same scale as features.css */
  --cs-fs-say: 18px;
  --cs-fs-h3: 28px;                /* v3: C1 spec (was 24 px) */
  --cs-fs-point: 16px;
  --cs-fs-body: 17px;
  --cs-fs-small: 14px;
  --cs-lh: 1.75;
  --cs-lh-h: 1.3;
  --cs-lh-tight: 1.4;
  --cs-lh-point: 1.6;
  --cs-lh-num: 1;
  --cs-measure: 34em;
  /* v3 C1 stage numeral (decorative, about 1.40:1 on --h-bg; the h3 carries the stage in text). 8cqi of the .cs-stages box (1200 px at 1440) = 96 px */
  --cs-num-size: clamp(72px, 8cqi, 112px);
  --cs-num-size-m: 56px;
  --cs-num-color: color-mix(in srgb, var(--navy) 16%, var(--h-bg));
  --cs-num-gap: 16px;
  --cs-num-gap-m: 12px;
  --cs-num-fs: var(--cs-num-size);
  /* v3 .cs-points */
  --cs-points-top: 8px;            /* lead to list: the stack gap plus this */
  --cs-points-gap: 8px;
  --cs-point-dot: 6px;
  --cs-point-indent: 12px;         /* dot to text */
  /* sizes */
  --cs-wrap: 1200px;
  --cs-pad: 96px;
  --cs-pad-m: 56px;
  --cs-gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --cs-gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --cs-txt-min: 280px;             /* stage text column: at least this, otherwise whatever the image leaves */
  --cs-art-w-min: 360px;           /* each block sets --art-w inline; it is clamped to this range */
  --cs-art-w-max: 820px;
  --cs-art-w-def: 640px;           /* used when a block has no --art-w */
  --cs-art-h-min: 360px;           /* each block may set --art-h inline (image max-height); it is clamped to this range */
  --cs-art-h-max: 640px;
  --cs-art-h-def: 520px;           /* used when a block has no --art-h */
  --cs-art-ph-h: 70cqi;            /* empty placeholder only: height min(--art-h, 70% of the section box); a pasted composite sets its own height */
  --cs-art-r: 12px;
  --cs-stage-gap: 96px;            /* between stage blocks, 64 px under 768 px */
  --cs-stage-gap-m: 64px;
  --cs-col-gap: 64px;              /* text-to-image gap: 280 + 64 + 820 = 1164 px, inside the 1200 px wrap */
  --cs-hair: 1px;
  --cs-focus: 3px;
  --cs-focus-off: 2px;
  --cs-s1: 4px;
  --cs-s2: 8px;
  --cs-s3: 12px;
  --cs-s4: 16px;
  --cs-s5: 20px;
  --cs-s6: 24px;
  --cs-s7: 32px;
  --cs-s8: 40px;
  --cs-s9: 56px;
  --cs-s10: 80px;
  /* reference only (container query values cannot read custom properties): roomy spacing from 768 px, 2-column stage blocks from 1024 px
     (the compact step bar under 640 px went with the step bar, owner 29 พ.ย. 2569) */
  --cs-bp-roomy: 768px;
  --cs-bp-split: 1024px;

  background: var(--cs-bg);
  color: var(--cs-ink);
  font-family: var(--font-body);
  font-size: var(--cs-fs-body);
  line-height: var(--cs-lh);
}
/* ds-allow-hardcode:end */

.cs *, .cs *::before, .cs *::after { box-sizing: border-box; }
.cs :where(h2, h3, p, ol, ul, figure) { margin: 0; }
.cs :where(ol, ul) { padding: 0; list-style: none; }
.cs img { display: block; max-width: 100%; height: auto; }
.cs ::selection { background: var(--navy); color: var(--white); }
.cs .nw { white-space: nowrap; }
.cs .num { font-variant-numeric: tabular-nums; }
/* no links or buttons in the shell; any the composites bring get the site ring */
.cs :focus-visible { outline: var(--cs-focus) solid var(--navy); outline-offset: var(--cs-focus-off); }

.cs-in {
  max-width: calc(var(--cs-wrap) + var(--cs-gutter-l) + var(--cs-gutter-r));
  margin: 0 auto;
  padding: var(--cs-pad-m) var(--cs-gutter-r) var(--cs-pad-m) var(--cs-gutter-l);
}
@container cs (min-width: 768px) { .cs-in { padding-block: var(--cs-pad); } }

/* ---------- head (.cs-head h2 sub, project chip) and the 5-step bar (.cs-steps .cs-dot): removed, owner 29 พ.ย. 2569 ----------
   The section opens on stage 1. h2#cases-title stays for aria-labelledby, visually hidden with .cs-sr (defined with the stage rules below). */

/* ---------- stage blocks: text then image (stacked); from 1024 px image on the side data-art names at its own --art-w, text takes the rest ---------- */
/* no margin-top since the head went (owner 29 พ.ย. 2569): stage 1 starts on the section top padding, same as the last stage ends on the bottom padding */
.cs-stages { container: cs-stg / inline-size; display: grid; gap: var(--cs-stage-gap-m); }
@container cs (min-width: 768px) { .cs-stages { gap: var(--cs-stage-gap); } }
/* image size per block: the owner sets style="--art-w: 640px" on each .cs-stage (clamped to 360 to 820 px) and, only where a block needs it,
   --art-h for the image max-height (default 520 px, clamped to 360 to 640 px) */
.cs-stage {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--cs-s6); align-items: start;
  --cs-art-w: clamp(var(--cs-art-w-min), var(--art-w, var(--cs-art-w-def)), var(--cs-art-w-max));
  --cs-art-h: clamp(var(--cs-art-h-min), var(--art-h, var(--cs-art-h-def)), var(--cs-art-h-max));
}
/* image side per block (owner sets data-art on each .cs-stage). The image column never squeezes the text under 280 px:
   at a narrow 2-column box it gives way first (min() against the container width) */
@container cs (min-width: 1024px) {
  .cs-stage {
    --cs-art-col: min(var(--cs-art-w), calc(100% - var(--cs-txt-min) - var(--cs-col-gap)));
    column-gap: var(--cs-col-gap);
  }
  .cs-stage > .cs-txt, .cs-stage > .cs-art { grid-row: 1; }
  .cs-stage[data-art="right"] { grid-template-columns: minmax(var(--cs-txt-min), 1fr) var(--cs-art-col); }
  .cs-stage[data-art="right"] > .cs-txt { grid-column: 1; }
  .cs-stage[data-art="right"] > .cs-art { grid-column: 2; }
  .cs-stage[data-art="left"] { grid-template-columns: var(--cs-art-col) minmax(var(--cs-txt-min), 1fr); }
  .cs-stage[data-art="left"] > .cs-art { grid-column: 1; }
  .cs-stage[data-art="left"] > .cs-txt { grid-column: 2; }
}
/* v3 text column = C1 row: .cs-txt.cs-row holds the ghost numeral and .cs-stack (h3, sentence, optional .cs-points / .cs-note) */
@container cs (max-width: 767px) { .cs { --cs-num-fs: var(--cs-num-size-m); --cs-num-gap: var(--cs-num-gap-m); } }
.cs-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.cs-row { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--cs-num-gap); align-items: start; align-content: start; min-width: 0; }
.cs-num {
  font-family: var(--font-head); font-weight: 700; font-size: var(--cs-num-fs); line-height: var(--cs-lh-num);
  font-variant-numeric: tabular-nums; color: var(--cs-num-color);
}
.cs-stack { display: grid; gap: var(--cs-s2); align-content: start; min-width: 0; }
.cs-h3 { font-family: var(--font-head); font-weight: 700; font-size: var(--cs-fs-h3); line-height: var(--cs-lh-h); color: var(--cs-title); }
.cs-say { font-size: var(--cs-fs-say); line-height: var(--cs-lh); max-width: var(--cs-measure); text-wrap: pretty; }
.cs-note { font-size: var(--cs-fs-small); line-height: var(--cs-lh-tight); color: var(--cs-muted); max-width: var(--cs-measure); }
/* .cs-points: lead sentence + short lines, reusable by the other stages. No bullet glyph: a small navy dot centred on the first line */
.cs-points {
  display: grid; gap: var(--cs-points-gap); margin-top: var(--cs-points-top);
  max-width: var(--cs-measure); font-size: var(--cs-fs-point); line-height: var(--cs-lh-point); color: var(--cs-ink);
}
.cs-points li { position: relative; padding-left: calc(var(--cs-point-dot) + var(--cs-point-indent)); text-wrap: pretty; }
.cs-points li::before {
  content: ""; position: absolute; left: 0; top: calc((var(--cs-lh-point) * 1em - var(--cs-point-dot)) / 2);
  width: var(--cs-point-dot); height: var(--cs-point-dot); border-radius: 50%; background: var(--navy);
}

/* image area: the box a stage composite is pasted into. Free aspect inside its --art-w x --art-h; full width under 1024 px, still capped at --art-w */
.cs-art { width: 100%; max-width: var(--cs-art-w); max-height: var(--cs-art-h); min-width: 0; }
.cs-art.is-empty {
  display: grid; place-content: center; justify-items: center; gap: var(--cs-s1);
  height: min(var(--cs-art-h), var(--cs-art-ph-h)); padding: var(--cs-s6);
  border: var(--cs-hair) dashed var(--cs-line); border-radius: var(--cs-art-r);
  color: var(--cs-muted); text-align: center;
}
.cs-art-ph { font-size: var(--cs-fs-body); font-weight: 500; line-height: var(--cs-lh-tight); }
.cs-art-size { font-size: var(--cs-fs-small); line-height: var(--cs-lh-tight); }

/* ---------- v3 stage 4 picture (เก็บเงิน), from s4-billing/block.html v7 T3 ---------- */
/* 4 pieces in a square box (640 x 640 at 1440, = #cases-4 --art-w/--art-h), all placed in the box's own cqi so the layout holds at any width:
     back   ใบวางบิล งวด 3 (img/billing-a4.webp, whole A4 sheet), rotated -3deg
     front  ใบเสร็จรับเงิน งวด 2 (img/receipt-a4.webp, whole A4 sheet), upright; it must cover the billing note's "0.00" cells
            (sheet x 67% to 93%, y 28% to 43.5%) at every width
     table  งวดงานทั้งหมด of the app (img/milestone-narrow.webp, 1148 x 470), lower right in front of the receipt (its y 68%, under the payment box)
     card   the app's donut card (img/finance-donut.webp, 560 x 482), left edge, its bottom on the bottom of the table's navy header row
   At most 3 pieces overlap at any point (the card is capped 4 px short of the receipt's left edge on phones). */
/* ds-allow-hardcode:start  picture tokens: geometry in cqi of .cs-s4, px only for the card's floor/cap and paper trim */
.cs-s4 {
  --cs-s4-box: 640px;               /* = --art-w of #cases-4 */
  --cs-s4-k: 1;                     /* sheet scale and offset (T3 = the v6 spot) */
  --cs-s4-ox: 0cqi;
  --cs-s4-oy: 0cqi;
  --cs-s4-sheet-w: 62.5cqi;         /* 400 px at 1440 */
  --cs-s4-bill-x: 2.4cqi;
  --cs-s4-bill-y: 1.6cqi;
  --cs-s4-bill-turn: -3deg;
  --cs-s4-rcpt-x: 37.5cqi;
  --cs-s4-rcpt-y: 5.3cqi;
  --cs-s4-tw: 84.4cqi;              /* table width, 540 px at 1440 (status chips 11.3 px) */
  --cs-s4-ms-head: .3432;           /* header-row bottom above the box bottom, share of --cs-s4-tw (.4094 x .838) */
  --cs-s4-ms-r: .0209;              /* the app card's 12 px corner, share of the table width (12 / 574) */
  --cs-s4-chart-w: round(clamp(120px, 29.2cqi, min(188px, calc(var(--cs-s4-rcpt-x) - 4px))), 2px);
  --cs-s4-chart-pad: 12px;
  --cs-s4-paper-r: 2px;
  --cs-s4-shadow: 0 12px 32px rgba(10, 22, 40, .08);
  --cs-s4-shadow-lg: 0 24px 60px rgba(10, 22, 40, .18), 0 2px 6px rgba(10, 22, 40, .08);
}
/* ds-allow-hardcode:end */
.cs-s4 {
  container: cs-s4 / inline-size; position: relative; box-sizing: content-box;
  width: 100%; max-width: var(--cs-s4-box); aspect-ratio: 1; margin: 0;
}
.cs-s4-doc {
  position: absolute; margin: 0; width: calc(var(--cs-s4-sheet-w) * var(--cs-s4-k)); aspect-ratio: 210 / 297;
  background: var(--white); border: var(--cs-hair) solid var(--cs-line); border-radius: var(--cs-s4-paper-r); overflow: hidden;
}
.cs-s4-doc img { display: block; width: 100%; height: 100%; max-width: none; }
.cs-s4-bill {
  position: absolute; z-index: 1;
  left: calc(var(--cs-s4-ox) + var(--cs-s4-bill-x) * var(--cs-s4-k)); top: calc(var(--cs-s4-oy) + var(--cs-s4-bill-y) * var(--cs-s4-k));
  width: calc(var(--cs-s4-sheet-w) * var(--cs-s4-k)); transform: rotate(var(--cs-s4-bill-turn));
}
.cs-s4-bill .cs-s4-doc { position: relative; width: 100%; box-shadow: var(--cs-s4-shadow); }
.cs-s4-doc-rcpt {
  z-index: 2; box-shadow: var(--cs-s4-shadow-lg);
  left: calc(var(--cs-s4-ox) + var(--cs-s4-rcpt-x) * var(--cs-s4-k)); top: calc(var(--cs-s4-oy) + var(--cs-s4-rcpt-y) * var(--cs-s4-k));
}
.cs-s4-ms {
  position: absolute; z-index: 3; right: 0; bottom: 0; width: var(--cs-s4-tw); margin: 0;
  aspect-ratio: 1148 / 470; overflow: hidden; border-radius: calc(var(--cs-s4-tw) * var(--cs-s4-ms-r));
  background: var(--white); border: var(--cs-hair) solid var(--cs-line); box-shadow: var(--cs-s4-shadow-lg);
}
.cs-s4-ms img { display: block; width: 100%; height: 100%; max-width: none; }
.cs-s4-chart {
  position: absolute; z-index: 4; left: 0; bottom: calc(var(--cs-s4-tw) * var(--cs-s4-ms-head)); width: var(--cs-s4-chart-w);
  margin: 0; padding: var(--cs-s4-chart-pad); box-sizing: border-box;
  background: var(--white); border: var(--cs-hair) solid var(--cs-line); border-radius: var(--cs-s4-paper-r); box-shadow: var(--cs-s4-shadow-lg);
}
.cs-s4-chart img { display: block; width: 100%; height: auto; }

/* ==== ช่วงที่ 1 เสนอราคา · cs-s1- · ประกอบ 29 พ.ย. 2569 จาก s1-quote/s1.css v4.2 ==== */
/* From s1-quote/block.html v4.3 (owner "ประกอบได้เลย" 29 พ.ย. 2569). 3 real app screens in a square box (640 x 640 at 1440, = #cases-1
   --art-w/--art-h), drawn on a 640 design grid: --cs-s1-u = 100cqi / grid of .cs-s1-fan (1u = 1 px at 1440), so the layout holds at any
   width. Stage 4's visual language: pieces near 1:1, one tall dominant piece, the back piece tilted -3deg past the box edge. Back to front:
     1 .cs-s1-crm  /crm sales board, 4 columns ร่าง รอผล อยู่ระหว่างแก้ไข ได้งาน, 2 cards each (s1-quote/img/crm-4col-t.webp 1384 x 890),
                   x -18 y 30, 638.1 wide (692 css px x .92 + 2 px border), rotate -3deg; all 4 column heads above the panel top,
                   the ได้งาน column runs behind the panel, the QT2569-042 card ends left of the panel
     2 .cs-s1-reg  /quotations register rows 043 / 042 / 041 (img/quote-rows.webp 616 x 384), x 0 y 416, 297.7 wide (x .96),
                   on the board floor over the second-row cards, its blank right end under the panel
     3 .cs-s1-new  the สร้างใบเสนอราคา side panel for QT2569-042 (img/quote-create-s.webp 758 x 1056), right 0 (x 289.3) y 128,
                   350.7 wide (x .93), front, tallest; its มูลค่ารวม VAT 26,215,000.00 stays uncovered
   Nothing faded, the box does not clip (as .cs-s4), at most 3 pieces meet. Under a 1024 px frame the picture has no gap on its left, so the
   grid widens to 668 (box aspect 668 / 640, every piece 28u to the right) and the tilted board's corner stays on screen; the box itself
   stays inside .cs-art (at most --art-w), so there the pieces are 640 / 668 of their 1440 size at most. */
/* ds-allow-hardcode:start  picture tokens: grid units (unitless, x --cs-s1-u), the app's corner radii in grid units, paper trim;
   the two shadows are the s4 paper shadows (--cs-s4-shadow + edge, --cs-s4-shadow-lg) re-declared here, same values, no new colour */
.cs-s1-fan {
  --cs-s1-box: 640px;               /* = --art-w of #cases-1 */
  --cs-s1-grid: 640;
  --cs-s1-u: calc(100cqi / var(--cs-s1-grid));
  --cs-s1-ox: 0px;
  --cs-s1-ratio: 1;
  --cs-s1-turn: -3deg;
  --cs-s1-crm-x: -18;
  --cs-s1-crm-y: 30;
  --cs-s1-crm-w: 638.1;
  --cs-s1-crm-r: 11;                /* the app's 12 px column corner x .92 */
  --cs-s1-reg-y: 416;
  --cs-s1-reg-w: 297.7;
  --cs-s1-reg-r: 11.5;              /* the app's 12 px card corner x .96 */
  --cs-s1-new-y: 128;
  --cs-s1-new-w: 350.7;
  --cs-s1-paper-r: 2px;             /* a square-edged side panel in the app; 2 px like the s4 paper */
  --cs-s1-shadow-back: 0 12px 32px rgba(10, 22, 40, .08), 0 2px 6px rgba(10, 22, 40, .08);
  --cs-s1-shadow-front: 0 24px 60px rgba(10, 22, 40, .18), 0 2px 6px rgba(10, 22, 40, .08);
}
@container cs (max-width: 1023px) {
  .cs-s1-fan { --cs-s1-grid: 668; --cs-s1-ox: calc(28 * var(--cs-s1-u)); --cs-s1-ratio: 668 / 640; }
}
/* ds-allow-hardcode:end */
.cs-s1-fan {
  container: cs-s1 / inline-size; position: relative;
  width: 100%; max-width: var(--cs-s1-box); aspect-ratio: var(--cs-s1-ratio); margin: 0;
}
.cs-s1-pc { position: absolute; margin: 0; overflow: hidden; background: var(--white); border: var(--cs-hair) solid var(--cs-line); }
.cs-s1-pc img { display: block; width: 100%; height: auto; max-width: none; }
.cs-s1-crm {
  z-index: 1; transform: rotate(var(--cs-s1-turn)); box-shadow: var(--cs-s1-shadow-back);
  left: calc(var(--cs-s1-ox) + var(--cs-s1-crm-x) * var(--cs-s1-u)); top: calc(var(--cs-s1-crm-y) * var(--cs-s1-u));
  width: calc(var(--cs-s1-crm-w) * var(--cs-s1-u)); border-radius: calc(var(--cs-s1-crm-r) * var(--cs-s1-u));
}
.cs-s1-reg {
  z-index: 2; box-shadow: var(--cs-s1-shadow-front);
  left: var(--cs-s1-ox); top: calc(var(--cs-s1-reg-y) * var(--cs-s1-u));
  width: calc(var(--cs-s1-reg-w) * var(--cs-s1-u)); border-radius: calc(var(--cs-s1-reg-r) * var(--cs-s1-u));
}
.cs-s1-new {
  z-index: 3; box-shadow: var(--cs-s1-shadow-front);
  right: 0; top: calc(var(--cs-s1-new-y) * var(--cs-s1-u));
  width: calc(var(--cs-s1-new-w) * var(--cs-s1-u)); border-radius: var(--cs-s1-paper-r);
}
/* ==== จบช่วงที่ 1 ==== */

/* ==== ช่วงที่ 5 ส่งมอบงาน · cs-s5- · ประกอบ 29 พ.ย. 2569 จาก s5-handover/s5.css v5.7 ==== */
/* From s5-handover/block.html v5.7 (owner "ประกอบได้เลย" 29 พ.ย. 2569). 3 real app screens, no paper, in a square box (640 x 640 at 1440,
   = #cases-5 --art-w/--art-h), drawn on a 640 design grid: --cs-s5-u = 100cqi / 640 of .cs-s5 (1u = 1 px at 1440), so the layout holds at
   any width. Renamed flat from s5.css: .fan -> .cs-s5, .pc -> .cs-s5-pc, .pc-k/.pc-s/.pc-a -> .cs-s5-k/.cs-s5-s/.cs-s5-a. Back to front:
     S .cs-s5-s  the "S-Curve (12 งาน)" card of /projects/s-curve (s5-handover/img/scurve-short.webp 1440 x 1178, viewport 1440 x 810,
                 card 720 x 589), x 0 y 160 w 584 z 1 (584 x 478, x0.808, ends y 638): the whole card, header and legend included, under K
     A .cs-s5-a  the คืนเงินประกันผลงาน card (img/retention-narrow.webp 740 x 614, shot at 370 px), x 356 y 395 w 276 z 2 (276 x 229,
                 ends x 632 y 624), under S's actual line so neither line nor the crossing is covered
     K .cs-s5-k  the 4 StatCards of /finance/milestone in one row (img/kpi-row.webp 1372 x 314), x 0 y 0 w 640 z 3 (640 x 148)
   K and A do not meet, so at most 2 pieces at any point. Every piece opaque white, 1 px --cs-line, 3 px corners, the s4 receipt's two
   shadows. No tilt, so the box needs no phone offset (unlike .cs-s1-fan); the box does not clip. */
/* ds-allow-hardcode:start  picture tokens: grid units (unitless, x --cs-s5-u), the piece corner, the s4 receipt shadow re-declared
   here (same value as --cs-s4-shadow-lg and --cs-s1-shadow-front, no new colour) */
.cs-s5 {
  --cs-s5-box: 640px;               /* = --art-w of #cases-5 */
  --cs-s5-grid: 640;
  --cs-s5-u: calc(100cqi / var(--cs-s5-grid));
  --cs-s5-s-x: 0;
  --cs-s5-s-y: 160;
  --cs-s5-s-w: 584;
  --cs-s5-a-x: 356;
  --cs-s5-a-y: 395;
  --cs-s5-a-w: 276;
  --cs-s5-k-x: 0;
  --cs-s5-k-y: 0;
  --cs-s5-k-w: 640;
  --cs-s5-pc-r: 3px;                /* piece corners, like the s4 receipt sheet */
  --cs-s5-shadow: 0 24px 60px rgba(10, 22, 40, .18), 0 2px 6px rgba(10, 22, 40, .08);
}
/* ds-allow-hardcode:end */
.cs-s5 {
  container: cs-s5 / inline-size; position: relative;
  width: 100%; max-width: var(--cs-s5-box); aspect-ratio: 1; margin: 0;
}
.cs-s5-pc {
  position: absolute; margin: 0; overflow: hidden; line-height: 0;
  background: var(--white); border: var(--cs-hair) solid var(--cs-line); border-radius: var(--cs-s5-pc-r);
  box-shadow: var(--cs-s5-shadow);
}
.cs-s5-pc img { display: block; width: 100%; height: auto; max-width: none; }
.cs-s5-s {
  z-index: 1;
  left: calc(var(--cs-s5-s-x) * var(--cs-s5-u)); top: calc(var(--cs-s5-s-y) * var(--cs-s5-u)); width: calc(var(--cs-s5-s-w) * var(--cs-s5-u));
}
.cs-s5-a {
  z-index: 2;
  left: calc(var(--cs-s5-a-x) * var(--cs-s5-u)); top: calc(var(--cs-s5-a-y) * var(--cs-s5-u)); width: calc(var(--cs-s5-a-w) * var(--cs-s5-u));
}
.cs-s5-k {
  z-index: 3;
  left: calc(var(--cs-s5-k-x) * var(--cs-s5-u)); top: calc(var(--cs-s5-k-y) * var(--cs-s5-u)); width: calc(var(--cs-s5-k-w) * var(--cs-s5-u));
}
/* ==== จบช่วงที่ 5 ==== */

/* ช่วงที่ 3 ทำงาน (cs-s3-) ประกอบ 29 พ.ย. 2569 จาก s3-work/s3.css แบบ 1 */
/* From s3-work/block-v1.html (owner "ประกอบได้เลย" 29 พ.ย. 2569). 2 real app screens, no phone, no A4 paper, in a square box (640 x 640
   at 1440, = #cases-3 --art-w/--art-h), drawn on a 640 design grid: --cs-s3-u = 100cqi / 640 of .cs-s3 (1u = 1 px at 1440), so the layout
   holds at any width. Only แบบ 1 (.cs-s3-v1) is kept; the root keeps both classes cs-s3 cs-s3-v1 as in block-v1.html. Back to front:
     R .cs-s3-r  the PR page /purchase/pr/PR-2569-0087 (s3-work/img/pr-page.webp 2182 x 2246), x 0 y 0 w 572 (572 x 588.7) z 1,
                 stepper at y 29 to 84 clear of P
     P .cs-s3-p  the budget panel of /purchase/pr, 7 cards (s3-work/img/budget-panel-long.webp 862 x 1936) in a white margin, x 380 y 104
                 w 246 (246 x 527.6) z 2, tilted -3deg (rotated box 366.4, 97.9, 273.1 x 537.2), over R's unit price and amount columns
   At most 2 pieces at any point. Every piece opaque white, 1 px --cs-line. The custom property --cs-s3 (12 px spacing, above) is a
   different name from the class .cs-s3 and is not touched. */
/* ds-allow-hardcode:start  ตัวแปรภาพ: หน่วยตาราง (ไม่มีหน่วย คูณ --cs-s3-u) มุมโค้งเป็นหน่วยตาราง เงา 2 แบบ
   เป็นค่าเดียวกับ --cs-s1-shadow-back และ --cs-s4-shadow-lg ข้างบน ไม่มีสีใหม่ */
.cs-s3 {
  --cs-s3-box: 640px;               /* = --art-w of #cases-3 */
  --cs-s3-grid: 640;
  --cs-s3-u: calc(100cqi / var(--cs-s3-grid));
  --cs-s3-turn: -3deg;              /* tilted piece, as in stages 1 and 4 */
  --cs-s3-shot-r: 8;                /* PR page screenshot corner */
  --cs-s3-panel-pad: 10;            /* white margin round the budget panel */
  --cs-s3-panel-r: 14;
  --cs-s3-shadow-back: 0 12px 32px rgba(10, 22, 40, .08), 0 2px 6px rgba(10, 22, 40, .08);
  --cs-s3-shadow: 0 24px 60px rgba(10, 22, 40, .18), 0 2px 6px rgba(10, 22, 40, .08);
}
/* แบบ 1 ใบขอซื้อนำ (ที่ 1440: R 0,0 กว้าง 572 สูง 588.7 · P 380,104 กว้าง 246 สูง 527.6 กรอบหลังเอียง x 366 ถึง 640 y 98 ถึง 635) */
.cs-s3-v1 {
  --cs-s3-r-x: 0;      /* หน้าใบขอซื้อ ครบ stepper หัวใบ ตาราง 12 รายการ และผลเทียบราคา · stepper อยู่ที่ y 29 ถึง 84 พ้นแผงงบ */
  --cs-s3-r-y: 0;
  --cs-s3-r-w: 572;
  --cs-s3-p-x: 380;    /* แผงงบ 7 การ์ด ทับขวาล่างของ R กว้าง 192 หน่วย (ช่องราคาต่อหน่วยและจำนวนเงิน) */
  --cs-s3-p-y: 104;
  --cs-s3-p-w: 246;
}
/* ds-allow-hardcode:end */
.cs-s3 {
  container: cs-s3 / inline-size; position: relative;
  width: 100%; max-width: var(--cs-s3-box); aspect-ratio: 1; margin: 0;
}
.cs-s3-pc {
  position: absolute; margin: 0; overflow: hidden; line-height: 0; box-sizing: border-box;
  background: var(--white); border: var(--cs-hair) solid var(--cs-line); box-shadow: var(--cs-s3-shadow);
}
.cs-s3-pc img { display: block; width: 100%; height: auto; max-width: none; }
/* piece kinds */
.cs-s3-shot { border-radius: calc(var(--cs-s3-shot-r) * var(--cs-s3-u)); }
.cs-s3-panel {
  padding: calc(var(--cs-s3-panel-pad) * var(--cs-s3-u));
  border-radius: calc(var(--cs-s3-panel-r) * var(--cs-s3-u));
}
.cs-s3-back { box-shadow: var(--cs-s3-shadow-back); }
.cs-s3-turn { transform: rotate(var(--cs-s3-turn)); }
/* positions: x y width per piece (R PR page · P budget panel) */
.cs-s3-r { left: calc(var(--cs-s3-r-x) * var(--cs-s3-u)); top: calc(var(--cs-s3-r-y) * var(--cs-s3-u)); width: calc(var(--cs-s3-r-w) * var(--cs-s3-u)); }
.cs-s3-p { left: calc(var(--cs-s3-p-x) * var(--cs-s3-u)); top: calc(var(--cs-s3-p-y) * var(--cs-s3-u)); width: calc(var(--cs-s3-p-w) * var(--cs-s3-u)); }
/* layers: the back piece (.cs-s3-back) below, the front piece above */
.cs-s3-pc { z-index: 2; }
.cs-s3-back { z-index: 1; }
/* ==== จบช่วงที่ 3 ==== */

/* ช่วง 2 ได้งาน (s2-won แบบ K) */
/* ช่วงที่ 2 ได้งาน (cs-s2-) ประกอบ 29 พ.ย. 2569 จาก s2-won/s2.css แบบ K รอบ 4.3 (เจ้าของ "ประกอบได้เลย"). 2 real app screens in a
   740 x 639 box at 1440 (= #cases-2 --art-w; aspect 800 / 691), drawn on an 800 design grid: --cs-s2-u = 100cqi / 800 of .cs-s2
   (1u = 0.925 px at 1440), so the layout holds at any width. Back to front:
     G .cs-s2-gantt  the Gantt page top of /projects/gantt (s2-won/img/gantt-pb-cats.webp 2158 x 1200): stats card + toolbar + chart
                     card, view ทั้งคู่, zoom เดือน, clock 25 พ.ย. 69, plan #cbd5e1 / actual #b91c1c, 12 rows with the 4 work-step
                     milestones interleaved; x 0 y 0 w 800 (740 x 411.5 px at 1440) z 1, square-edged page cut
     B .cs-s2-boq    the BOQ แบบ B card (s2-won/img/boq-b-narrow.webp 1120 x 1228) at 0.818 of variant A, x 480 y 342 w 311 z 2, tilted
                     -3deg; its rotated box runs 334u to the box floor 691u and to the right edge 800u, so it covers rows 9 to 12 only
                     (not started + ส่งมอบงาน): the staircase, roof 90%, สถาปัตย์ and the today line through rows 1 to 8 stay clear
   At 1440 the BOQ table figures are about 6.1 px and 20,100,000 about 12.3 px. Below 1024 px the box goes full width, same layout. */
/* ds-allow-hardcode:start  ตัวแปรภาพ: หน่วยตาราง (ไม่มีหน่วย คูณ --cs-s2-u) เงา 2 แบบเป็นค่าเดียวกับ --cs-s1-shadow-back / -front ไม่มีสีใหม่ */
.cs-s2 {
  --cs-s2-box: 740px;               /* = --art-w of #cases-2 */
  --cs-s2-grid: 800;
  --cs-s2-u: calc(100cqi / var(--cs-s2-grid));
  --cs-s2-ratio: 800 / 691;
  --cs-s2-turn: -3deg;              /* tilted piece, as in stages 1 3 4 */
  --cs-s2-paper-r: 2px;             /* square-edged page cut, 2 px like the s4 paper */
  --cs-s2-g-x: 0;                   /* G Gantt page, full width from the top left */
  --cs-s2-g-y: 0;
  --cs-s2-g-w: 800;
  --cs-s2-b-x: 480;                 /* B BOQ card, bottom right under row 8 */
  --cs-s2-b-y: 342;
  --cs-s2-b-w: 311;
  --cs-s2-b-r: 6.6;                 /* app card radius 12 px at the card's scale */
  --cs-s2-shadow-back: 0 12px 32px rgba(10, 22, 40, .08), 0 2px 6px rgba(10, 22, 40, .08);
  --cs-s2-shadow-front: 0 24px 60px rgba(10, 22, 40, .18), 0 2px 6px rgba(10, 22, 40, .08);
}
/* ds-allow-hardcode:end */
.cs-s2 {
  container: cs-s2 / inline-size; position: relative;
  width: 100%; max-width: var(--cs-s2-box); aspect-ratio: var(--cs-s2-ratio); margin: 0;
}
.cs-s2-pc {
  position: absolute; margin: 0; overflow: hidden; line-height: 0; box-sizing: border-box;
  background: var(--white); border: var(--cs-hair) solid var(--cs-line);
}
.cs-s2-pc img { display: block; width: 100%; height: auto; max-width: none; }
.cs-s2-gantt {
  left: calc(var(--cs-s2-g-x) * var(--cs-s2-u)); top: calc(var(--cs-s2-g-y) * var(--cs-s2-u)); width: calc(var(--cs-s2-g-w) * var(--cs-s2-u));
  border-radius: var(--cs-s2-paper-r); z-index: 1; box-shadow: var(--cs-s2-shadow-back);
}
.cs-s2-boq {
  left: calc(var(--cs-s2-b-x) * var(--cs-s2-u)); top: calc(var(--cs-s2-b-y) * var(--cs-s2-u)); width: calc(var(--cs-s2-b-w) * var(--cs-s2-u));
  border-radius: calc(var(--cs-s2-b-r) * var(--cs-s2-u)); z-index: 2; box-shadow: var(--cs-s2-shadow-front); transform: rotate(var(--cs-s2-turn));
}
/* ==== จบช่วงที่ 2 ==== */

/* ---------- connector B: serpentine dashed line through the 5 stages (owner chose B 29 พ.ย. 2569 from connector/index.html) ----------
   Hook: <div class="cs-frame" data-cn="b">. cases.js (loaded with defer) draws one SVG inside .cs-in of #cases: a dashed path and a dot in a thin
   ring at each stage number. From a 1024 px frame (2 columns) the path runs down the gutter on the TEXT side of each block (stages with
   data-art="right" have text on the left, data-art="left" on the right) and turns with a rounded corner across the gap under the block, so it
   never crosses a picture or a line of text. Under a 1024 px frame (blocks stacked, text above picture) every stop is on the left, so the same
   script draws a straight line down the left gutter (variant A's look). Dot centre = ink centre of the faint number (--cs-cn-k x its font size).
   Colours: line --blue 30% into --h-bg, ring --blue 38%, dot --blue. No gold. Decorative only: aria-hidden, focusable="false", no text,
   pointer-events none, nothing to tab to, hidden in print. No JS = no line; the layout is the same either way (the SVG is absolute).
   Room for the line: the section gutters widen to 80 px on both sides from a 1024 px frame (at 1440 the content stays 1200 px, nothing moves)
   and to 56 / 40 px on the left only under 1024 / 768 px (content 40 / 24 px narrower than without the line; ring edge clear of the text). */
/* ds-allow-hardcode:start  connector tokens: stroke, dash, dot and ring sizes, the gutter the line lives in, the number-centre ratio */
.cs-frame[data-cn="b"] .cs {
  --cs-cn-line-c: color-mix(in srgb, var(--blue) 30%, var(--h-bg));
  --cs-cn-ring-c: color-mix(in srgb, var(--blue) 38%, var(--h-bg));
  --cs-cn-dot-c: var(--blue);
  --cs-cn-line-w: 2px;
  --cs-cn-dash: 6px;
  --cs-cn-space: 6px;
  --cs-cn-ring: 20px;
  --cs-cn-ring-w: 1.5px;
  --cs-cn-dot: 10px;
  --cs-cn-off: 22px;          /* line centre to the content's left edge (and to its right edge for right-side stops) */
  --cs-cn-turn: 24px;         /* corner radius of a turn */
  --cs-cn-k: .44;             /* dot centre from the number top, x its font size = ink centre of the digits (measured .443 at 96 px, .437 at 56 px) */
  --cs-gutter-l: max(40px, env(safe-area-inset-left, 0px));
}
@container cs (min-width: 768px) {
  .cs-frame[data-cn="b"] .cs {
    --cs-cn-line-w: 3px; --cs-cn-dash: 8px; --cs-cn-space: 8px;
    --cs-cn-ring: 30px; --cs-cn-dot: 16px; --cs-cn-off: 28px;
    --cs-gutter-l: max(56px, env(safe-area-inset-left, 0px));
  }
}
@container cs (min-width: 1024px) {
  .cs-frame[data-cn="b"] .cs {
    --cs-cn-ring: 40px; --cs-cn-dot: 22px; --cs-cn-off: 44px;
    --cs-gutter-l: max(80px, env(safe-area-inset-left, 0px));
    --cs-gutter-r: max(80px, env(safe-area-inset-right, 0px));
  }
}
/* ds-allow-hardcode:end */
/* the SVG sits under the stages inside .cs-in; isolation keeps these z-indexes local to the section (the fixed bars above it are untouched) */
.cs-frame[data-cn="b"] .cs-in { position: relative; isolation: isolate; }
.cs-frame[data-cn="b"] .cs-stages { position: relative; z-index: 1; }
.cs-cn { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 0; }
.cs-cn-path { fill: none; stroke: var(--cs-cn-line-c); stroke-width: var(--cs-cn-line-w); stroke-dasharray: var(--cs-cn-dash) var(--cs-cn-space); }
.cs-cn-ring { fill: var(--cs-bg); stroke: var(--cs-cn-ring-c); stroke-width: var(--cs-cn-ring-w); }
.cs-cn-dot { fill: var(--cs-cn-dot-c); }
@media print { .cs-cn { display: none; } }
