/* Ship hydrostatics and stability — on top of calc.css */
main.sh .tabs { grid-template-columns: repeat(3, 1fr); }
main.sh .stage-bar { justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
main.sh .stage-bar .hist { margin-left: auto; }
main.sh .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.hr { cursor: grab; }
#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 section */
.sh-sea { fill: var(--steel-blue); }
.sh-wl { stroke: var(--water-line); stroke-width: 1.4; }
.sh-hull { fill: var(--concrete); stroke: var(--steel-800); stroke-width: 1.4; stroke-linejoin: round; }
.sh-wet { fill: color-mix(in srgb, var(--water-line) 22%, transparent); stroke: none; }
.sh-wl0 { fill: none; stroke: var(--steel-550); stroke-width: .9; stroke-dasharray: 5 3; }
.sh-cl { fill: none; stroke: var(--steel-550); stroke-width: .8; stroke-dasharray: 9 3 1.5 3; }
.sh-bl { stroke: var(--moment); stroke-width: 1; stroke-dasharray: 3 3; }
.sh-vert { stroke: var(--steel-400); stroke-width: .9; stroke-dasharray: 3 3; }
.sh-arc { fill: none; stroke: var(--sel); stroke-width: 1.2; }
.sh-mast { stroke: var(--steel-400); stroke-width: 1; }
.sh-B { fill: var(--moment); }
.sh-B0 { fill: var(--surface); stroke: var(--moment); stroke-width: 1.2; }
.sh-M { fill: var(--surface); stroke: var(--text); stroke-width: 1.4; }
.sh-Gv { fill: var(--surface); stroke: var(--text); stroke-width: 1.2; }
.sh-pt { font-size: 12.5px; font-weight: 600; fill: var(--text); paint-order: stroke; stroke: var(--halo); stroke-width: 3px; }
.sh-load line { stroke: var(--load); stroke-width: 1.8; fill: none; }
.sh-load path.hd { fill: var(--load); stroke: none; }
.sh-load.sh-grey line { stroke: var(--steel-550); } .sh-load.sh-grey path.hd { fill: var(--steel-550); }
/* 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.good rect { stroke: color-mix(in srgb, var(--good) 45%, transparent); } #view .pill.good text { fill: var(--good-ink); font-weight: 600; }
#view .pill.bad rect { stroke: color-mix(in srgb, var(--bad) 45%, transparent); } #view .pill.bad text { fill: var(--bad-ink); font-weight: 600; }
#view .pill.water rect { stroke: color-mix(in srgb, var(--water-line) 45%, transparent); } #view .pill.water text { fill: var(--water-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.nm { cursor: text; }
#view .pill.editable { cursor: text; }
#view .pill.editable:hover rect, #view .pill.editable:focus rect, #view .pill.nm:hover rect { stroke: var(--sel); stroke-width: 1.4; }
#view .pill.editable:focus { outline: none; }

/* editors in the drawing */
.stage { position: relative; }
.sh-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); }
.sh-edit input { width: 82px; border: 0; outline: none; font: inherit; font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; padding: 3px 2px; }
.sh-edit-name input { width: 180px; text-align: center; }
.sh-edit span { font-size: 11.5px; color: var(--text-3); }
@media print { .sh-edit { display: none !important; } }

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

/* panel */
.sh-seg { margin-bottom: 6px; }
#panel .f .sh-seg { margin: 0; }
#panel input.bad { color: var(--bad); }
#panel .num:has(input.bad) input { border-color: var(--bad); }

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

/* charts */
.sh-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
#gchart .gdrag { cursor: ew-resize; }
#hchart .hdrag { cursor: ns-resize; }
#gchart, #hchart { touch-action: none; user-select: none; }
@media (max-width: 1100px) { .sh-two { grid-template-columns: minmax(0, 1fr); } }

.sh-crit { margin: 0 0 6px; padding-left: 18px; font-size: 12.5px; color: var(--text-2); line-height: 1.6; }

#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); }
#checks td.note { white-space: normal; min-width: 200px; line-height: 1.4; }
/* phones: the margins as stacked cards (no sideways scroll) */
@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: "provided "; color: var(--text-3); }
  #checks td:nth-child(3)::before { content: "required "; 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; }
}

/* 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-6e7177: #85827f; --x-cfd2d6: #3e3c39;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --x-1e4fbf: #749ff5; --x-6e7177: #85827f; --x-cfd2d6: #3e3c39;
  }
}
/* theme-auto:end */
