/* Sheet pile wall — on top of calc.css */
main.spw .stage-bar { justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
main.spw .stage-bar .hist { margin-left: auto; }
main.spw .stage-bar .seg { flex: 0 0 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.hx { cursor: ew-resize; }
#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); }

/* ground, water, the wall */
.sp-soil0 { fill: url(#spHatch); stroke: none; }
.sp-clay { fill: var(--x-e8e1d3, #e8e1d3); stroke: none; }
.sp-ground { stroke: var(--steel-700); stroke-width: 1.2; fill: none; }
.sp-layer { stroke: var(--x-8a7a5c, #8a7a5c); stroke-width: 1; stroke-dasharray: 8 3 2 3; fill: none; }
.sp-wet { fill: color-mix(in srgb, var(--x-5b8fc7, #5b8fc7) 10%, transparent); stroke: none; pointer-events: none; }
.sp-wt { stroke: var(--x-3f7cbf, #3f7cbf); stroke-width: 1.2; stroke-dasharray: 7 4; fill: none; }
.sp-wtm { fill: var(--x-3f7cbf, #3f7cbf); }
.sp-pool { fill: color-mix(in srgb, var(--x-5b8fc7, #5b8fc7) 18%, transparent); stroke: none; }
.sp-wall { fill: var(--steel-800); stroke: var(--x-2b3542, #2b3542); stroke-width: 1; }
.sp-toe { stroke: var(--rust); stroke-width: 1.2; stroke-dasharray: 6 3; fill: none; }
.sp-rod { stroke: var(--steel-700); stroke-width: 2; fill: none; }
.sp-dead { fill: url(#spConc); stroke: var(--steel-800); stroke-width: 1.1; }
.sp-net-a { fill: color-mix(in srgb, var(--load) 18%, transparent); stroke: var(--rust); stroke-width: 1; stroke-linejoin: round; }
.sp-net-p { fill: color-mix(in srgb, var(--good) 14%, transparent); stroke: var(--good); stroke-width: 1; stroke-linejoin: round; }
.sp-dim { fill: none; stroke: var(--steel-550); stroke-width: .9; }
.sp-dimh { fill: var(--steel-550); }
.sp-load line { stroke: var(--load); stroke-width: 1.8; fill: none; }
.sp-load path.hd { fill: var(--load); stroke: none; }
.sp-load.sp-thin line { stroke-width: 1.2; }
.sp-load.sp-react line { stroke: var(--steel-700); } .sp-load.sp-react path.hd { fill: var(--steel-700); }
.sp-name { font-size: 12.5px; font-weight: 600; fill: var(--text); }
.sp-role { font-size: 11px; fill: var(--text-3); }
.sp-nm { cursor: text; }
.sp-nm:hover .sp-name, .sp-nm:focus .sp-name { fill: var(--sel); }
.sp-nm:focus { outline: none; }

/* 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.dimv rect { stroke: var(--steel-200); }
#view .pill.load rect { stroke: color-mix(in srgb, var(--load) 35%, transparent); } #view .pill.load text { fill: var(--load-ink); font-weight: 600; }
#view .pill.desig rect { stroke: color-mix(in srgb, var(--sel) 45%, transparent); } #view .pill.desig text { fill: var(--x-1e4fbf, #1e4fbf); font-weight: 600; }
#view .pill.water rect { stroke: color-mix(in srgb, var(--x-3f7cbf, #3f7cbf) 45%, transparent); } #view .pill.water text { fill: var(--water-ink); font-weight: 600; }
#view .pill.grey rect { stroke: var(--steel-300); } #view .pill.grey text { fill: var(--text-2); font-weight: 600; }
#view .pill.toe rect { stroke: color-mix(in srgb, var(--rust) 40%, transparent); } #view .pill.toe text { fill: var(--x-9a3412, #9a3412); font-weight: 600; }
#view .pill.good rect { stroke: color-mix(in srgb, var(--good) 45%, transparent); } #view .pill.good text { fill: var(--x-1f6b45, #1f6b45); 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; }
.sp-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); }
.sp-edit input { width: 82px; border: 0; outline: none; font: inherit; font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; padding: 3px 2px; }
.sp-edit-name input { width: 180px; text-align: center; }
.sp-edit span { font-size: 11.5px; color: var(--text-3); }

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

/* panel */
.sp-seg { margin-bottom: 6px; }
.sp-check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); margin: 4px 0 4px; cursor: pointer; }
.sp-check input { margin: 0; }
.sp-sel { width: 100%; font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); }
.sp-row { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.sp-row > * { flex: 1 1 0; min-width: 0; }
.sp-lay { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px 6px; margin: 0 0 10px; }
.sp-lay-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.sp-lay-h input { 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; color: var(--text); background: transparent; }
.sp-lay-h input:hover, .sp-lay-h input:focus { border-color: var(--line); background: var(--surface); }
.sp-lay-h small { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.sp-x { border: 0; background: none; color: var(--text-3); cursor: pointer; font-size: 15px; padding: 2px 6px; border-radius: 6px; }
.sp-x:hover { color: var(--bad); background: var(--x-fbf1ef, #fbf1ef); }
.sp-add { width: 100%; }
#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, margins, sections */
.sp-say { margin-top: 6px; font-size: 12.5px; color: var(--text-2); line-height: 1.4; max-width: 34ch; }
.sp-tag { display: inline-block; font-size: 10.5px; color: var(--text-3); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; margin-left: 4px; white-space: nowrap; }
#checks td.note { white-space: normal; min-width: 200px; line-height: 1.4; }
.sp-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
#hchart .hdrag { cursor: ew-resize; }
#hchart { touch-action: none; user-select: none; }
.fb-chart text.halo { paint-order: stroke; stroke: var(--halo); stroke-width: 3px; stroke-linejoin: round; }
.sp-secs td.l { font-weight: 500; }
.sp-secs tr.cur td { background: var(--sel-bg); }
.sp-secs tr.cur td.l { color: var(--sel); }
.sp-secs .fam { font-size: 11px; color: var(--text-3); margin-left: 6px; font-weight: 400; }
@media (max-width: 1100px) { .sp-two { 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: "needed "; color: var(--text-3); }
  #checks td:nth-child(3)::before { content: "provided "; color: var(--text-3); }
  #checks td:nth-child(4) { grid-column: 1 / -1; grid-row: 3; font-size: 12px; color: var(--text-3); }
  .sp-secs thead { display: none; }
  .sp-secs, .sp-secs tbody { display: block; width: 100%; }
  .sp-secs tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .sp-secs td { display: block; border: 0; padding: 0; text-align: left; white-space: normal; }
  .sp-secs td:nth-child(1) { grid-column: 1; grid-row: 1; }
  .sp-secs td:nth-child(6) { grid-column: 2; grid-row: 1; }
  .sp-secs td:nth-child(2), .sp-secs td:nth-child(3), .sp-secs td:nth-child(4), .sp-secs td:nth-child(5) { font-size: 12px; color: var(--text-3); grid-column: 1 / -1; }
  .sp-secs td:nth-child(2)::before { content: "mass "; } .sp-secs td:nth-child(3)::before { content: "W "; } .sp-secs td:nth-child(4)::before { content: "class "; } .sp-secs td:nth-child(5)::before { content: "resistance "; }
}
@media print { .sp-edit { display: none !important; } }
@media (max-width: 600px) {
  main.spw #supSeg { width: 100%; grid-auto-columns: minmax(0, 1fr); }
  main.spw #supSeg button { white-space: normal; line-height: 1.25; padding: 4px 6px; }
}

/* 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-1e4fbf: #749ff5; --x-1f6b45: #77b18e; --x-2b3542: #b0bbc8; --x-3f7cbf: #82b4ee; --x-555555: #9d9a96;
    --x-5b8fc7: #91bded; --x-6e7177: #85827f; --x-8a7a5c: #8c7f67; --x-9a3412: #e0866b; --x-b9b3a6: #545047;
    --x-e8e1d3: #363229; --x-fbf1ef: #2c2625;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --x-1e4fbf: #749ff5; --x-1f6b45: #77b18e; --x-2b3542: #b0bbc8; --x-3f7cbf: #82b4ee; --x-555555: #9d9a96;
    --x-5b8fc7: #91bded; --x-6e7177: #85827f; --x-8a7a5c: #8c7f67; --x-9a3412: #e0866b; --x-b9b3a6: #545047;
    --x-e8e1d3: #363229; --x-fbf1ef: #2c2625;
  }
}
/* theme-auto:end */
