/* Retaining wall — on top of calc.css */
main.rw .stage-bar { justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
main.rw .stage-bar .hist { margin-left: auto; }
main.rw .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 footing */
.rw-sand { fill: url(#rwHatch); stroke: none; }
.rw-clay { fill: var(--x-e8e1d3, #e8e1d3); stroke: none; }
.rw-backfill { fill: var(--soil); stroke: var(--x-c9c3b5, #c9c3b5); stroke-width: .8; stroke-dasharray: 3 2; }
.rw-ground { stroke: var(--steel-700); stroke-width: 1.2; }
.rw-tick { stroke: var(--steel-550); stroke-width: .8; fill: none; }
.rw-layer { stroke: var(--x-8a7a5c, #8a7a5c); stroke-width: 1; stroke-dasharray: 8 3 2 3; }
.rw-wet { fill: color-mix(in srgb, var(--x-5b8fc7, #5b8fc7) 10%, transparent); stroke: none; pointer-events: none; }
.rw-wt { stroke: var(--x-3f7cbf, #3f7cbf); stroke-width: 1.2; stroke-dasharray: 7 4; }
.rw-wtm { fill: var(--x-3f7cbf, #3f7cbf); }
.rw-wt2 { stroke: var(--x-3f7cbf, #3f7cbf); stroke-width: 1; fill: none; }
.rw-pad { fill: url(#rwConc); stroke: var(--steel-800); stroke-width: 1.2; }
.rw-col { fill: url(#rwConc); stroke: var(--steel-800); stroke-width: 1.1; }
.rw-break { stroke: var(--steel-550); stroke-width: 1; stroke-dasharray: 3 2; fill: none; }
.rw-wedge { fill: color-mix(in srgb, var(--load) 14%, transparent); stroke: var(--rust); stroke-width: 1.2; stroke-linejoin: round; }
.rw-fan { fill: color-mix(in srgb, var(--load) 6%, transparent); stroke: var(--rust); stroke-width: 1; stroke-dasharray: 5 3; stroke-linejoin: round; }
.rw-pass { fill: none; stroke: var(--rust); stroke-width: 1; stroke-dasharray: 5 3; }
.rw-wedge.faint, .rw-fan.faint, .rw-pass.faint { opacity: .35; }
.rw-bp { fill: none; stroke: var(--rust); stroke-width: 1; }
.rw-dim { fill: none; stroke: var(--steel-550); stroke-width: .9; }
.rw-dimh { fill: var(--steel-550); }
.rw-ext { fill: none; stroke: var(--steel-400); stroke-width: .8; }
.rw-load line { stroke: var(--load); stroke-width: 1.8; fill: none; }
.rw-load path.hd { fill: var(--load); stroke: none; }
.rw-name { font-size: 12.5px; font-weight: 600; fill: var(--text); }
.rw-role { font-size: 11px; fill: var(--text-3); }
.rw-nm { cursor: text; }
.rw-nm:hover .rw-name, .rw-nm:focus .rw-name { fill: var(--sel); }
.rw-nm:focus { outline: none; }
.rw-planbg { fill: var(--surface); stroke: var(--line); }
.rw-plant { font-size: 10px; font-weight: 600; letter-spacing: .06em; fill: var(--text-3); }
.rw-planf { fill: var(--steel-100); stroke: var(--steel-800); stroke-width: 1; }
.rw-plane { fill: color-mix(in srgb, var(--load) 16%, transparent); stroke: var(--rust); stroke-width: .9; }
.rw-planp { fill: var(--load); }

/* 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.eff rect { stroke: color-mix(in srgb, var(--rust) 40%, transparent); } #view .pill.eff text { fill: var(--x-9a3412, #9a3412); 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; }
.rw-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); }
.rw-edit input { width: 82px; border: 0; outline: none; font: inherit; font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; padding: 3px 2px; }
.rw-edit-name input { width: 180px; text-align: center; }
.rw-edit span { font-size: 11.5px; color: var(--text-3); }

/* live strip and flags */
.rw-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; }
.rw-live b { font-weight: 500; color: var(--text-3); margin-right: 5px; }
.rw-live i { font-style: normal; color: var(--text-3); }
.rw-flags { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.rw-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 */
.rw-seg { margin-bottom: 6px; }
.rw-check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); margin: 4px 0 4px; cursor: pointer; }
.rw-check input { margin: 0; }
#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 */
.rw-say { margin-top: 6px; font-size: 12.5px; color: var(--text-2); line-height: 1.4; max-width: 34ch; }
.rw-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; }
.rw-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
#wchart .wdrag { cursor: ew-resize; }
#wchart { touch-action: none; user-select: none; }
.fb-chart text.halo { paint-order: stroke; stroke: var(--halo); stroke-width: 3px; stroke-linejoin: round; }
@media (max-width: 1100px) { .rw-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: "action "; color: var(--text-3); }
  #checks td:nth-child(3)::before { content: "resistance "; color: var(--text-3); }
  #checks td:nth-child(4) { grid-column: 1 / -1; grid-row: 3; font-size: 12px; color: var(--text-3); }
}
@media print { .rw-edit { display: none !important; } }

/* retaining wall parts */
.rw-fill { fill: var(--x-f1ede4, #f1ede4); stroke: none; }
.rw-conc { fill: url(#rwConc); stroke: var(--steel-800); stroke-width: 1.2; stroke-linejoin: round; }
.rw-virt { stroke: var(--steel-550); stroke-width: 1; stroke-dasharray: 6 3; }
.rw-pe { fill: color-mix(in srgb, var(--load) 13%, transparent); stroke: var(--rust); stroke-width: 1; }
.rw-pw { fill: color-mix(in srgb, var(--x-3f7cbf, #3f7cbf) 14%, transparent); stroke: var(--x-3f7cbf, #3f7cbf); stroke-width: 1; }
.rw-cp { fill: color-mix(in srgb, var(--steel-700) 12%, transparent); stroke: var(--steel-700); stroke-width: 1; }
.rw-third { stroke: var(--text); stroke-width: 1.2; }
.rw-load.rw-thin line { stroke-width: 1.2; }
.rw-load.rw-water line { stroke: var(--x-3f7cbf, #3f7cbf); } .rw-load.rw-water path.hd { fill: var(--x-3f7cbf, #3f7cbf); }
.rw-load.rw-grey line { stroke: var(--steel-550); } .rw-load.rw-grey path.hd { fill: var(--steel-550); }
.rw-load.rw-react line { stroke: var(--steel-700); } .rw-load.rw-react path.hd { fill: var(--steel-700); }
#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; }

/* 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-3f7cbf: #82b4ee; --x-555555: #9d9a96; --x-5b8fc7: #91bded; --x-6e7177: #85827f;
    --x-7a4fa0: #b895dc; --x-8a7a5c: #8c7f67; --x-9a3412: #e0866b; --x-b9b3a6: #545047; --x-be185d: #ee829f;
    --x-c9c3b5: #4a453c; --x-e8e1d3: #363229; --x-f1ede4: #2e2b26;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --x-1e4fbf: #749ff5; --x-3f7cbf: #82b4ee; --x-555555: #9d9a96; --x-5b8fc7: #91bded; --x-6e7177: #85827f;
    --x-7a4fa0: #b895dc; --x-8a7a5c: #8c7f67; --x-9a3412: #e0866b; --x-b9b3a6: #545047; --x-be185d: #ee829f;
    --x-c9c3b5: #4a453c; --x-e8e1d3: #363229; --x-f1ede4: #2e2b26;
  }
}
/* theme-auto:end */
