/* Well control kill sheet — on top of calc.css */
main.ks .tabs { grid-template-columns: repeat(3, 1fr); }
main.ks .stage-bar { justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
main.ks .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 .knob { fill: var(--surface); stroke: var(--sel); stroke-width: 1.8; }
#view .handle:hover .knob, #view .handle:focus .knob { fill: var(--sel); }
#view .cdrag { cursor: ew-resize; }

/* the well */
.ks-earth { fill: var(--soil); }
.ks-ground { stroke: var(--x-8a8172, #8a8172); stroke-width: 1.4; fill: none; }
.ks-csg { fill: var(--steel-500); stroke: var(--steel-750); stroke-width: .8; }
.ks-shoe { fill: var(--steel-750); }
.ks-oh { fill: none; stroke: var(--x-b9ad97, #b9ad97); stroke-width: 1.2; stroke-dasharray: 4 3; }
.ks-gas { stroke: var(--x-e0a060, #e0a060); stroke-width: 1; }
.ks-str { fill: var(--steel-100); stroke: var(--steel-750); stroke-width: 1; }
.ks-bit { fill: none; stroke: var(--steel-750); stroke-width: 1.4; }
.ks-line { fill: none; stroke: var(--steel-750); stroke-width: 1.4; }
.ks-gauge { fill: var(--surface); stroke: var(--steel-750); stroke-width: 1.4; }
.ks-name { font-size: 12.5px; font-weight: 600; fill: var(--text); }
.ks-nmw { cursor: text; }
.ks-nmw:hover .ks-name, .ks-nmw:focus .ks-name { fill: var(--sel); }
.ks-nmw:focus { outline: none; }
.ks-tick { font-size: 10.5px; fill: var(--text-3); font-variant-numeric: tabular-nums; }
.ks-axt { font-size: 11px; fill: var(--text-3); }

/* the pressure charts */
.ks-plot { fill: var(--surface); stroke: var(--faint); stroke-width: 1; }
.ks-grid { fill: var(--fill-1); stroke: none; }
.ks-ptitle { font-size: 12.5px; font-weight: 600; fill: var(--text); }
.ks-dp { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.ks-cp { fill: none; stroke: var(--load); stroke-width: 2; stroke-linejoin: round; }
.ks-maasp { fill: none; stroke: var(--steel-500); stroke-width: 1.1; stroke-dasharray: 5 4; }
.ks-shoep { fill: none; stroke: var(--moment); stroke-width: 2; stroke-linejoin: round; }
.ks-frac { fill: none; stroke: var(--bad); stroke-width: 1.2; stroke-dasharray: 5 4; }
.ks-ok { fill: color-mix(in srgb, var(--good) 7%, transparent); }
.ks-ev { fill: none; stroke: var(--steel-400); stroke-width: 1; stroke-dasharray: 2 3; }
.ks-evt { font-size: 10.5px; font-weight: 500; fill: var(--text-3); paint-order: stroke; stroke: var(--halo); stroke-width: 3px; }
.ks-ll { font-size: 11.5px; font-weight: 600; paint-order: stroke; stroke: var(--halo); stroke-width: 3px; }
.ks-cur { fill: none; stroke: var(--sel); stroke-width: 1.2; stroke-dasharray: 4 3; }
.ks-curpill { fill: var(--surface); stroke: var(--sel); }
.ks-curtxt { font-size: 11.5px; font-weight: 600; fill: var(--sel); font-variant-numeric: tabular-nums; }

/* 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.gp rect { stroke: color-mix(in srgb, var(--ink) 35%, transparent); } #view .pill.gp text { fill: var(--text); font-weight: 600; }
#view .pill.cp rect, #view .pill.kp rect { stroke: color-mix(in srgb, var(--load) 45%, transparent); } #view .pill.cp text, #view .pill.kp text { fill: var(--load-ink); font-weight: 600; }
#view .pill.mp rect, #view .pill.kmp rect { stroke: color-mix(in srgb, var(--x-8a6e3c, #8a6e3c) 45%, transparent); } #view .pill.mp text, #view .pill.kmp text { fill: var(--x-6b5328, #6b5328); 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; }
.ks-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); }
.ks-edit input { width: 82px; border: 0; outline: none; font: inherit; font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; padding: 3px 2px; }
.ks-edit-name input { width: 180px; text-align: center; }
.ks-edit span { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }

/* live strip and flags */
.ks-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; }
.ks-live b { font-weight: 500; color: var(--text-3); margin-right: 5px; }
.ks-live i { font-style: normal; color: var(--text-3); }
.ks-flags { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.ks-flags span { font-size: 11.5px; color: var(--text-3); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.ks-flags span.bad, .ks-flags span.ks-err { color: var(--bad-ink, #b0321f); border-color: color-mix(in srgb, var(--bad) 35%, transparent); white-space: normal; }

/* panel */
.ks-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); }

/* panel */
.ks-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); }

/* summary */
.ks-say { margin-top: 6px; font-size: 12.5px; color: var(--text-2); line-height: 1.4; max-width: 40ch; }
.ks-big { font-weight: 600; color: var(--x-6b5328, #6b5328); }

/* the kill sheet */
.ks-sheet { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 28px; }
.ks-sheet h3 { font-size: 13px; font-weight: 600; margin: 0 0 6px; }
.ks-kv, .ks-sched { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ks-kv td { padding: 5px 8px 5px 0; border-bottom: 1px solid var(--fill-1); text-align: right; vertical-align: top; }
.ks-kv td.l { text-align: left; }
.ks-kv td:nth-child(2) { font-weight: 600; color: var(--text); white-space: nowrap; }
.ks-kv td.ks-s { color: var(--text-3); font-size: 12px; padding-left: 10px; }
.ks-sched th { font-weight: 500; color: var(--text-3); text-align: right; padding: 4px 8px; border-bottom: 1px solid var(--line); }
.ks-sched td { text-align: right; padding: 4px 8px; border-bottom: 1px solid var(--fill-1); }
.ks-sched td:last-child { font-weight: 600; color: var(--text); }
#ktChart { touch-action: none; user-select: none; }
#ktChart .cdrag { cursor: ns-resize; }
#checks td.note { white-space: normal; min-width: 200px; line-height: 1.4; }

@media (max-width: 900px) { .ks-sheet { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  #checks thead { display: none; }
  #checks, #checks 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: "actual "; color: var(--text-3); }
  #checks td:nth-child(3)::before { content: "allowed "; 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; }
  .ks-kv td.ks-s { display: none; }
}
@media print { .ks-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-6b5328: #af9a76; --x-6e7177: #85827f;
    --x-8a6e3c: #bba279; --x-8a8172: #7b7468; --x-8f979f: #61676d; --x-b0321f: #ef8470; --x-b39769: #b8a17b;
    --x-b9ad97: #5c5343; --x-dccfb2: #463d2a; --x-e0a060: #f3be8a; --x-fff3e0: #2d261a;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --x-1d4fbf: #749ff5; --x-2c4a91: #81a0e0; --x-5b78b8: #96b0e8; --x-6b5328: #af9a76; --x-6e7177: #85827f;
    --x-8a6e3c: #bba279; --x-8a8172: #7b7468; --x-8f979f: #61676d; --x-b0321f: #ef8470; --x-b39769: #b8a17b;
    --x-b9ad97: #5c5343; --x-dccfb2: #463d2a; --x-e0a060: #f3be8a; --x-fff3e0: #2d261a;
  }
}
/* theme-auto:end */
