:root {
  color-scheme: light;
  --ink: #1f2933;
  --muted: #667085;
  --line: #cfd6df;
  --soft: #f5f7fa;
  --panel: #ffffff;
  --accent: #9ccc3c;
  --accent-dark: #566f1b;
  --blue: #2563a6;
  --warn: #b36b00;
  --danger: #b42318;
  --pass: #087443;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: #e9edf2;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  color: #fff;
  background: #3c444d;
  border-bottom: 5px solid var(--accent);
}

.eyebrow {
  margin: 0 0 2px;
  color: #cfe98a;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 26px;
}

h2 {
  font-size: 17px;
}

.status-pill {
  min-width: 126px;
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  text-align: center;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.08);
}

.status-pill.pass {
  background: var(--pass);
}

.status-pill.warn {
  background: var(--warn);
}

.status-pill.fail {
  background: var(--danger);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 18px;
  align-items: start;
  margin-top: 18px;
}

.form-panel,
.results-panel {
  display: grid;
  gap: 14px;
}

.band,
.summary,
.plan-view {
  background: var(--panel);
  border: 1px solid var(--line);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  color: #fff;
  background: #4b535c;
}

.section-title span {
  color: #ddf3a5;
  font-weight: 700;
}

.grid {
  display: grid;
  gap: 0;
}

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: #4b5563;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 35px;
  padding: 7px 9px;
  border: 1px solid #b7c0cb;
  background: #fff;
  color: var(--ink);
  border-radius: 4px;
  font-weight: 600;
}

input:focus,
select:focus {
  outline: 2px solid rgba(37, 99, 166, 0.24);
  border-color: var(--blue);
}

.calculation-table {
  display: grid;
}

.row {
  display: grid;
  grid-template-columns: 1.05fr repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.row > div:first-child,
.row output {
  display: grid;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border-right: 1px solid var(--line);
  font-weight: 800;
}

.row output {
  color: #614a00;
  background: #fff083;
}

.row.head {
  color: #fff;
  background: var(--accent-dark);
}

.row.head div {
  padding: 9px 10px;
  border-right: 1px solid rgba(255, 255, 255, 0.28);
  font-weight: 800;
}

.summary,
.plan-view {
  overflow: hidden;
}

.summary h2,
.plan-view h2 {
  padding: 11px 14px;
  color: #fff;
  background: #4b535c;
}

dl {
  margin: 0;
}

dl div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}

dt {
  color: #4b5563;
  font-weight: 700;
}

dd {
  margin: 0;
  color: var(--ink);
  font-weight: 900;
}

.plan-view svg {
  display: block;
  width: 100%;
  height: auto;
}

.svg-bg {
  fill: #f8fafc;
}

.radius {
  fill: rgba(156, 204, 60, 0.12);
  stroke: #7aa51f;
  stroke-width: 2;
  stroke-dasharray: 5 5;
}

.boom {
  stroke: #252b32;
  stroke-width: 11;
  stroke-linecap: round;
}

.hook-line {
  stroke: #58616c;
  stroke-width: 2;
}

.crane-body {
  fill: #f1c232;
  stroke: #7b6410;
}

.cab {
  fill: #4f8ac9;
  stroke: #1d4775;
}

.load {
  fill: #d9dee5;
  stroke: #687380;
  stroke-width: 2;
}

text {
  fill: #1f2933;
  font-size: 15px;
  font-weight: 800;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.print-report {
  display: none;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: var(--blue);
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  filter: brightness(0.95);
}

button + button {
  color: var(--ink);
  background: #d7dde5;
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .results-panel {
    grid-row: 1;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 10px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .grid.four,
  .row {
    grid-template-columns: 1fr;
  }

  label,
  .row > div:first-child,
  .row output {
    border-right: 0;
  }
}

@media print {
  @page {
    size: letter portrait;
    margin: 4mm;
  }

  html,
  body {
    background: #fff;
    width: 100%;
    min-width: 0;
  }

  .app-shell {
    width: 100%;
    padding: 0;
  }

  .topbar,
  .layout {
    display: none;
  }

  .actions {
    display: none;
  }

  .print-report {
    display: block;
    color: #111;
    font-size: 8.1px;
    line-height: 1.12;
    transform: scale(1.12);
    transform-origin: top left;
    width: 89.3%;
  }

  .report-head {
    display: grid;
    grid-template-columns: 1fr 82px 96px;
    border: 1px solid #111;
    border-bottom: 0;
    min-height: 32px;
  }

  .report-title {
    display: grid;
    place-items: center;
    text-align: center;
    border-right: 1px solid #111;
  }

  .report-title h2 {
    margin: 0;
    font-size: 16px;
    letter-spacing: 0;
  }

  .report-title span {
    font-size: 9px;
    font-weight: 700;
  }

  .report-logo,
  .report-plan-no {
    display: grid;
    place-items: center;
    border-right: 1px solid #111;
    font-weight: 900;
  }

  .report-logo img {
    display: block;
    width: 72px;
    max-height: 24px;
    object-fit: contain;
  }

  .report-plan-no {
    border-right: 0;
    font-size: 20px;
  }

  .report-top-grid {
    display: grid;
    grid-template-columns: 1fr 1.05fr 1.15fr;
    border-left: 1px solid #111;
    border-top: 1px solid #111;
  }

  .report-block,
  .report-table,
  .report-notes {
    border-right: 1px solid #111;
    border-bottom: 1px solid #111;
  }

  .report-block h3,
  .report-table h3 {
    margin: 0;
    padding: 2.5px 4px;
    border-bottom: 1px solid #111;
    background: #e2e5e9;
    font-size: 9px;
  }

  .report-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: 16px;
    border-bottom: 1px solid #111;
  }

  .report-row:last-child {
    border-bottom: 0;
  }

  .report-row.four {
    grid-template-columns: 1.35fr 0.9fr 1.25fr 0.9fr;
  }

  .report-row.subhead {
    grid-template-columns: 1.1fr 1.6fr 0.9fr 0.6fr;
    background: #f4f5f6;
  }

  .report-row.tall {
    min-height: 26px;
  }

  .report-row span,
  .report-row strong,
  .report-notes div,
  .report-notes p {
    padding: 2.5px 4px;
    border-right: 1px solid #111;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .report-row strong {
    font-weight: 900;
  }

  .report-row span:last-child,
  .report-row strong:last-child {
    border-right: 0;
  }

  .sketch-block {
    min-height: 170px;
  }

  .sketch-block svg {
    display: block;
    width: 100%;
    height: 170px;
  }

  .sketch-block text {
    font-size: 9px;
    fill: #444;
  }

  #reportBoomLabel {
    fill: #b23b30;
    font-weight: 900;
  }

  #reportRadiusLabel {
    fill: #b23b30;
    font-size: 11px;
    font-weight: 900;
  }

  .report-table {
    border-left: 1px solid #111;
    border-top: 0;
  }

  .highlight {
    background: #fff200;
  }

  .object-table .report-row:first-child,
  .people-table .report-row:first-child {
    background: #e2e5e9;
    font-weight: 900;
  }

  .calc-table .report-row strong {
    font-size: 10px;
  }

  .report-notes {
    border-left: 1px solid #111;
  }

  .report-notes div {
    border-bottom: 1px solid #111;
  }

  .report-notes p {
    margin: 0;
    color: #a11818;
    border-right: 0;
  }

  .report-page-no {
    padding-top: 10px;
    text-align: center;
    font-size: 8px;
  }
}
