/* Casing design — on top of calc.css */
main.cs .tabs { grid-template-columns: repeat(3, 1fr); }
main.cs .stage-bar { justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
main.cs .stage-bar .hist { margin-left: auto; }
#view { display: block; width: 100%; height: auto; user-select: none; touch-action: none; }
#view .hit { fill: transparent; stroke: none; }
#view .handle { cursor: grab; }
#view .handle.hy { cursor: ns-resize; }
#view .handle.hx { cursor: ew-resize; }
#view .handle .knob { fill: var(--surface); stroke: var(--sel); stroke-width: 1.8; }
#view .handle:hover .knob, #view .handle:focus .knob { fill: var(--sel); }

/* the well */
.cs-earth { fill: var(--soil); }
.cs-ground { stroke: var(--x-8a8172, #8a8172); stroke-width: 1.4; fill: none; }
.cs-hole { fill: var(--soil-2); stroke: var(--x-b9ad97, #b9ad97); stroke-width: .8; }
.cs-hole.oh { stroke-dasharray: 4 3; }
.cs-mudrun { fill: var(--x-d8c9a9, #d8c9a9); opacity: .75; }
.cs-mudin { fill: var(--x-c9d6ea, #c9d6ea); }
.cs-mudin.oh { fill: var(--x-c9d6ea, #c9d6ea); opacity: .7; }
.cs-level { stroke: var(--moment); stroke-width: 1.2; fill: none; }
.cs-wall { stroke: var(--steel-750); stroke-width: .9; }
.cs-wall.hot { stroke: var(--sel); }
.cs-joint { stroke: var(--steel-750); stroke-width: 1.4; fill: none; }
.cs-shoe { fill: var(--steel-750); stroke: none; }
.cs-td { stroke: var(--x-8a8172, #8a8172); stroke-width: 1.6; fill: none; }
.cs-snm { font-size: 11px; font-weight: 600; fill: var(--text); }
.cs-sspec { font-size: 10.5px; fill: var(--text-3); font-variant-numeric: tabular-nums; }
.cs-nm, .cs-nmw { cursor: text; }
.cs-nm:hover .cs-snm, .cs-nm:focus .cs-snm, .cs-nmw:hover .cs-name, .cs-nmw:focus .cs-name { fill: var(--sel); }
.cs-nm:focus, .cs-nmw:focus { outline: none; }
.cs-name { font-size: 12.5px; font-weight: 600; fill: var(--text); }

/* the load panels */
.cs-plot { fill: var(--surface); stroke: var(--faint); stroke-width: 1; }
.cs-grid { fill: var(--fill-1); stroke: none; }
.cs-tick { font-size: 10.5px; fill: var(--text-3); font-variant-numeric: tabular-nums; }
.cs-axt { font-size: 11px; fill: var(--text-3); }
.cs-ptitle { font-size: 12.5px; font-weight: 600; fill: var(--text); }
.cs-ok { fill: color-mix(in srgb, var(--good) 7%, transparent); stroke: none; }
.cs-cap { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.cs-cap0 { fill: none; stroke: var(--steel-500); stroke-width: 1.1; stroke-dasharray: 5 4; }
.cs-cap2 { fill: none; stroke: var(--x-5b78b8, #5b78b8); stroke-width: 1.6; stroke-linejoin: round; }
.cs-load { fill: none; stroke: var(--steel-500); stroke-width: 1.2; stroke-dasharray: 3 3; }
.cs-dl { fill: none; stroke: var(--load); stroke-width: 2; stroke-linejoin: round; }
.cs-shoeline { stroke: var(--steel-400); stroke-width: 1; stroke-dasharray: 2 3; fill: none; }
.cs-ll { font-size: 11px; font-weight: 500; fill: var(--text-3); paint-order: stroke; stroke: var(--halo); stroke-width: 3px; }
.cs-ll.cap { fill: var(--ink); }
.cs-ll.dl { fill: var(--load-ink); }
.cs-ll.cap2 { fill: var(--x-2c4a91, #2c4a91); }

/* pills */
#view .pill rect { fill: var(--surface); stroke: var(--steel-300); }
#view .pill text { font-size: 11.5px; font-weight: 500; fill: var(--text-2); font-variant-numeric: tabular-nums; }
#view .pill.sp rect, #view .pill.tp rect { stroke: color-mix(in srgb, var(--sel) 40%, transparent); } #view .pill.sp text, #view .pill.tp text { fill: var(--x-1d4fbf, #1d4fbf); font-weight: 600; }
#view .pill.ep rect { stroke: color-mix(in srgb, var(--moment) 45%, transparent); } #view .pill.ep text { fill: var(--x-2c4a91, #2c4a91); font-weight: 600; }
#view .pill.pp rect, #view .pill.fp rect, #view .pill.mp rect, #view .pill.op rect { stroke: color-mix(in srgb, var(--load) 45%, transparent); } #view .pill.pp text, #view .pill.fp text, #view .pill.mp text, #view .pill.op text { fill: var(--load-ink); font-weight: 600; }
#view .pill.editable { cursor: text; }
#view .pill.editable:hover rect, #view .pill.editable:focus rect { stroke: var(--sel); stroke-width: 1.4; }
#view .pill.editable:focus { outline: none; }

/* editors in the drawing */
.stage { position: relative; }
.cs-edit { position: absolute; transform: translate(-50%, -50%); z-index: 5; display: flex; align-items: center; gap: 4px; background: var(--surface); border: 1.5px solid var(--sel); border-radius: 9px; padding: 2px 8px 2px 4px; box-shadow: 0 6px 18px rgba(20, 22, 28, .14); }
.cs-edit input { width: 82px; border: 0; outline: none; font: inherit; font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; padding: 3px 2px; }
.cs-edit-name input { width: 180px; text-align: center; }
.cs-edit span { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }

/* live strip and flags */
.cs-live { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; min-height: 38px; align-items: center; }
.cs-live b { font-weight: 500; color: var(--text-3); margin-right: 5px; }
.cs-live i { font-style: normal; color: var(--text-3); }
.cs-flags { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.cs-flags span { font-size: 11.5px; color: var(--text-3); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.cs-flags span.bad, .cs-flags span.cs-err { color: var(--bad-ink, #b0321f); border-color: color-mix(in srgb, var(--bad) 35%, transparent); white-space: normal; }

/* panel */
.cs-seg { margin-bottom: 6px; }
#panel input.bad { color: var(--bad); }
#panel .num:has(input.bad) input { border-color: var(--bad); }
#panel.fade-b { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 32px), transparent); }
#panel.fade-t { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 28px); mask-image: linear-gradient(to bottom, transparent, #000 28px); }
#panel.fade-t.fade-b { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 28px, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to bottom, transparent, #000 28px, #000 calc(100% - 32px), transparent); }
.cs-sec { border-top: 1px solid var(--line); padding: 8px 0 4px; }
.cs-sec:first-child { border-top: 0; padding-top: 2px; }
.cs-sec-h { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.cs-nm { font: inherit; font-size: 13px; font-weight: 600; border: 1px solid transparent; border-radius: 6px; padding: 3px 6px; min-width: 0; flex: 1 1 auto; background: transparent; color: var(--text); }
.cs-nm:hover { border-color: var(--line); }
.cs-nm:focus { border-color: var(--sel); outline: none; background: var(--surface); }
.cs-sub { font-size: 11.5px; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cs-del { font-size: 14px; line-height: 1; padding: 2px 8px; }
#panel select { max-width: 100%; }

/* summary */
.cs-say { margin-top: 6px; font-size: 12.5px; color: var(--text-2); line-height: 1.4; max-width: 40ch; }

/* sections table */
.cs-secs { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.cs-secs th { font-weight: 500; color: var(--text-3); text-align: right; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.cs-secs td { text-align: right; padding: 7px 8px; border-bottom: 1px solid var(--fill-1); vertical-align: top; }
.cs-secs .l { text-align: left; }
.cs-secs td b { font-weight: 600; }
.cs-sub2 { display: block; font-size: 11.5px; color: var(--text-3); }

/* charts */
.cs-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.cs-rn { font-size: 11px; }
#checks td.note { white-space: normal; min-width: 200px; line-height: 1.4; }

@media (max-width: 1100px) { .cs-two { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  #checks thead, .cs-secs thead { display: none; }
  #checks, #checks tbody, .cs-secs, .cs-secs tbody { display: block; width: 100%; }
  #checks tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
  #checks td { display: block; border: 0; padding: 0; text-align: left; white-space: normal; }
  #checks td.chk { grid-column: 1; grid-row: 1; }
  #checks td:nth-child(5) { grid-column: 2; grid-row: 1; align-self: center; }
  #checks td:nth-child(2) { grid-column: 1; grid-row: 2; font-size: 12.5px; }
  #checks td:nth-child(3) { grid-column: 2; grid-row: 2; font-size: 12.5px; text-align: right; }
  #checks td:nth-child(2)::before { content: "load × DF "; color: var(--text-3); }
  #checks td:nth-child(3)::before { content: "rating "; color: var(--text-3); }
  #checks td:nth-child(4) { grid-column: 1 / -1; grid-row: 3; font-size: 12px; color: var(--text-3); min-width: 0; }
  .cs-secs tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
  .cs-secs td { display: block; border: 0; padding: 0; text-align: left; }
  .cs-secs td:nth-child(n+3)::before { color: var(--text-3); margin-right: 4px; }
  .cs-secs td:nth-child(3)::before { content: "D/t"; }
  .cs-secs td:nth-child(4)::before { content: "range"; }
  .cs-secs td:nth-child(5)::before { content: "collapse"; }
  .cs-secs td:nth-child(6)::before { content: "burst"; }
  .cs-secs td:nth-child(7)::before { content: "body"; }
  .cs-secs td:nth-child(8)::before { content: "joint"; }
  .cs-secs td:nth-child(9)::before { content: "drift"; }
}
@media print { .cs-edit { display: none !important; } }

/* theme-auto:start · generated by scripts/theme/hexmap.py: dark values (the rule of scripts/theme/colour.py) for
   colours that are not tokens, written as var(--x-rrggbb, #rrggbb): light is the fallback, unchanged */
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --x-1d4fbf: #749ff5; --x-2c4a91: #81a0e0; --x-5b78b8: #96b0e8; --x-6e7177: #85827f; --x-6f7680: #7a8088;
    --x-8a5a0e: #c89e6a; --x-8a8172: #7b7468; --x-8f979f: #61676d; --x-b9ad97: #5c5343; --x-c3c9d1: #3f4348;
    --x-c9d6ea: #323b48; --x-cfd8cf: #363c36; --x-d8c9a9: #514730; --x-d9dde3: #373532;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --x-1d4fbf: #749ff5; --x-2c4a91: #81a0e0; --x-5b78b8: #96b0e8; --x-6e7177: #85827f; --x-6f7680: #7a8088;
    --x-8a5a0e: #c89e6a; --x-8a8172: #7b7468; --x-8f979f: #61676d; --x-b9ad97: #5c5343; --x-c3c9d1: #3f4348;
    --x-c9d6ea: #323b48; --x-cfd8cf: #363c36; --x-d8c9a9: #514730; --x-d9dde3: #373532;
  }
}
/* theme-auto:end */
