/* bearing life — on top of calc.css */
main.brg { --ring: var(--steel-200); --ring-s: var(--steel-600); --el: var(--steel-50); --el-s: var(--steel-700); --q: var(--moment); --q2: var(--x-8a4a8a, #8a4a8a); }
main.brg .stage-bar { justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
main.brg .stage-bar .hist { margin-left: auto; }
#view { display: block; width: 100%; height: auto; flex: 1; min-height: 0; user-select: none; touch-action: none; }
#view.dragging, #view.dragging * { cursor: grabbing !important; }
#view .handle { cursor: grab; }
#view .handle.v { cursor: ns-resize; }
#view .handle.h { cursor: ew-resize; }
#view .handle .knob { fill: var(--surface); stroke: var(--sel); stroke-width: 1.8; }
#view .handle:hover .knob { fill: var(--sel); }

/* flat section */
#view .ring { fill: var(--ring); stroke: var(--ring-s); stroke-width: .9; stroke-linejoin: round; }
#view .snapg { fill: var(--surface); stroke: var(--ring-s); stroke-width: .7; }
#view .snaph { fill: var(--surface); stroke: none; }
#view .snapr { fill: var(--steel-700); stroke: var(--ink); stroke-width: .6; }
.br-sub { font-size: 12px; font-weight: 600; color: var(--text-2); margin: 8px 0 0; }
.facts dd small { color: var(--text-3); font-size: 11px; margin-left: 4px; }
#view .relm { fill: var(--el); stroke: var(--el-s); stroke-width: .9; stroke-linejoin: round; }
#view .relm.hot { fill: var(--steel-blue); stroke: var(--q); stroke-width: 1.4; }
#view .shaft { fill: var(--steel-50); stroke: var(--steel-400); stroke-width: .8; stroke-dasharray: 4 3; }
#view .cl { stroke: var(--steel-500); stroke-width: .7; stroke-dasharray: 12 3 2 3; fill: none; }
#view .cline { stroke: var(--q); stroke-width: .9; stroke-dasharray: 5 3; fill: none; }
#view .cage { stroke: var(--steel-500); stroke-width: 1.4; fill: none; }
#view .zone { fill: color-mix(in srgb, var(--moment) 7%, transparent); stroke: none; }
#view .zarc { fill: none; stroke: var(--q); stroke-width: 1; }
#view .qbar { fill: var(--q); }
#view .qenv { fill: none; stroke: var(--q); stroke-width: 1.1; stroke-linejoin: round; }
#view .tick { stroke: var(--steel-500); stroke-width: .7; }
#view .cap { font-size: calc(11px * var(--tk, 1)); fill: var(--text-3); }
#view .capb { font-size: calc(11.5px * var(--tk, 1)); fill: var(--text-2); font-weight: 500; }
#view .zl { font-size: calc(11px * var(--tk, 1)); fill: var(--q); font-weight: 500; }
#view .pill rect { fill: var(--surface); stroke: var(--steel-300); }
#view .pill text { font-size: calc(11.5px * var(--tk, 1)); font-weight: 500; fill: var(--text-2); font-variant-numeric: tabular-nums; }
#view .pill.editable { cursor: text; }
#view .pill.editable:hover rect { stroke: var(--sel); stroke-width: 1.4; }
#view .pill.editable:focus { outline: none; }
#view .pill.editable:focus rect { stroke: var(--sel); stroke-width: 1.6; }
#view .pill.load rect { stroke: color-mix(in srgb, var(--load) 40%, transparent); } #view .pill.load text { fill: var(--load); font-weight: 600; }
#view .pill.q rect { stroke: color-mix(in srgb, var(--moment) 40%, transparent); } #view .pill.q text { fill: var(--q); font-weight: 600; }
#view .pill.title text { fill: var(--text); font-weight: 600; }
#view .pill.title.editable rect { stroke: var(--steel-350); }
#view .leader { stroke: var(--steel-500); stroke-width: .8; fill: none; }
#view .arr { stroke: var(--load); stroke-width: 1.8; fill: none; }
#view .arrh { fill: var(--load); }
#view .rot { stroke: var(--text-3); stroke-width: 1.1; fill: none; }
#view .roth { fill: var(--text-3); }

.br-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: 34px; align-items: center; }
.br-live b { font-weight: 500; color: var(--text-3); margin-right: 4px; }
.br-live .x-ok { color: var(--good); font-weight: 500; }
.br-live .x-no { color: var(--bad); font-weight: 500; }

/* in-place editor */
.br-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); }
.br-edit input { width: 92px; border: 0; outline: none; font: inherit; font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; padding: 3px 2px; }
.br-edit span { font-size: 11.5px; color: var(--text-3); }
.stage { position: relative; }

/* examples menu */
.ex-wrap { position: relative; }

/* panel bits */
#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); }
.f.segf { grid-template-columns: minmax(0, 1fr) auto; }
.f.segf .seg button { padding: 4px 9px; font-size: 12.5px; }
.f.segf.stack { grid-template-columns: minmax(0, 1fr); gap: 4px; }
.f.segf.stack .seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); width: 100%; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 12.5px; color: var(--text-2); margin: 4px 0 0; font-variant-numeric: tabular-nums; }
.facts dt { color: var(--text-3); }
.facts dd { margin: 0; text-align: right; }
.src-tag { font-size: 11px; color: var(--text-3); }
.src-tag a { color: var(--text-3); }
.est-tag { font-size: 11px; color: var(--text-3); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; margin-left: 6px; white-space: nowrap; }
.br-range { width: 100%; accent-color: var(--text-2); }
.br-hint { font-size: 12px; color: var(--text-3); margin: 4px 0 0; line-height: 1.45; }
.br-hint a { color: var(--text-2); }

/* summary */
.br-sum { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; }
.story { padding: 14px 20px; display: grid; align-content: center; gap: 6px; min-width: 0; }
.story p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text); max-width: 72ch; }
.story p.sub { font-size: 12.5px; color: var(--text-2); }
.story .mode { display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.story a { color: var(--text-2); }
.br-mini { display: grid; grid-template-columns: repeat(2, minmax(150px, 1fr)); border-left: 1px solid var(--line); }
.br-mini .stat { border-left: 0; border-top: 1px solid var(--line); }
.br-mini .stat:nth-child(-n+2) { border-top: 0; }
.br-mini .stat:nth-child(even) { border-left: 1px solid var(--line); }
@media (max-width: 1320px) {
  .br-sum { grid-template-columns: minmax(0, 1fr); }
  .br-mini { grid-template-columns: repeat(4, minmax(0, 1fr)); border-left: 0; border-top: 1px solid var(--line); }
  .br-mini .stat { border-top: 0; border-left: 1px solid var(--line); }
  .br-mini .stat:first-child { border-left: 0; }
}
@media (max-width: 700px) {
  .br-mini { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .br-mini .stat:nth-child(odd) { border-left: 0; }
  .br-mini .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
}
main.brg #summary { min-height: 183px; }
@media (max-width: 1320px) { main.brg #summary { min-height: 250px; } }
@media (max-width: 700px) { main.brg #summary { min-height: 470px; } }

/* margins with failure icons */
#checks tr[data-check] { cursor: pointer; }
#checks td.chk { display: flex; align-items: center; gap: 10px; white-space: normal; min-width: 170px; }
#checks td.chk .th { flex: none; width: 46px; height: 46px; margin: -6px 0; }
#checks td.chk:focus-visible { outline: 2px solid var(--sel); outline-offset: -2px; border-radius: 6px; }
#checks td.note { white-space: normal; min-width: 180px; }
#checks .guide-tag { font-size: 11px; color: var(--text-3); margin-left: 6px; white-space: nowrap; }
#checks tr.ref td { color: var(--text-3); }
.br-pv { position: fixed; z-index: 60; width: 232px; padding: 9px 10px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 28px rgba(20, 24, 30, .14); pointer-events: none; font-size: 12px; color: var(--text); }
.br-pv[hidden] { display: none; }
.br-pv svg { display: block; width: 212px; height: auto; margin: 4px 0 6px; }
.br-pv .pv-h { font-weight: 600; font-size: 12px; }
.br-pv .pv-c { color: var(--text-2); line-height: 1.35; }
.br-pv .pv-m { margin-top: 4px; color: var(--text-3); }
@media print { .br-pv { display: none !important; } }

/* charts */
.br-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
#chart, #kchart { display: block; width: 100%; height: auto; touch-action: none; user-select: none; }
#chart .drag, #kchart .drag { cursor: ew-resize; }
.ch-t { font-size: 10.5px; fill: var(--text-3); font-variant-numeric: tabular-nums; }
.ch-a { font-size: 11px; fill: var(--text-2); }
.ch-l { font-size: 11px; font-weight: 600; }
@media (max-width: 1040px) { .br-row { grid-template-columns: minmax(0, 1fr); } }

/* duty cycle and sizes */
table.duty td input { width: 84px; border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; text-align: right; font: inherit; font-size: 13px; font-variant-numeric: tabular-nums; background: var(--surface); }
table.duty td input:focus { border-color: var(--text-2); outline: none; }
table.duty tr.cur td { background: var(--bg); }
table.duty td.n { color: var(--text-3); }
#addRow { margin-top: 10px; }
table.sizes tr.cur td { background: var(--bg); }
table.sizes tr.cur td.l { font-weight: 600; }
table.sizes tbody tr { cursor: pointer; }

/* steps */
details.step.gov > summary .t::after { content: "governs"; margin-left: 10px; font-size: 11px; font-weight: 600; color: var(--bad); letter-spacing: .03em; text-transform: uppercase; }
.step .where { font-size: 12px; color: var(--text-3); margin: 6px 0 0; line-height: 1.6; }
.refs-body .md-src li { margin: 5px 0; }
.sec-tag { font-style: normal; font-size: 11px; color: var(--text-3); border: 1px solid var(--line); border-radius: 999px; padding: 0 6px; margin-left: 4px; }

@media (max-width: 700px) {
  #checks th:nth-child(4), #checks td:nth-child(4) { display: none; }
  .margins td, .margins th { padding-left: 4px; padding-right: 4px; }
  .margins .ms { min-width: 54px; padding: 2px 6px; }
  #checks td.chk { min-width: 0; gap: 6px; }
  #checks td.chk .th { width: 40px; height: 40px; }
  .step .eq .katex { font-size: .86em; }
  table.sizes th:nth-child(3), table.sizes td:nth-child(3), table.sizes th:nth-child(4), table.sizes td:nth-child(4) { display: none; }
  table.duty td input { width: 62px; }
}
@media (max-width: 560px) { .ex-menu { min-width: 260px; } .story { padding: 12px 14px; } }
@media (max-width: 560px) {
  main.brg #typeSeg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: row; width: 100%; }
}
@media (max-width: 1040px) {
  main.brg .work { display: contents; }
  main.brg > * { order: 10; }
  main.brg .stage { order: 1; }
  main.brg #summary { order: 2; }
  main.brg .panel { order: 3; contain: none; }
}
@media (max-width: 700px) {
  table.duty th:nth-child(n+7), table.duty td:nth-child(n+7) { display: none; }
  table.duty td:last-child, table.duty th:last-child { display: table-cell; }
  table.duty td input { width: 54px; padding: 4px; font-size: 12.5px; }
  table.sizes th:nth-child(5), table.sizes td:nth-child(5) { display: none; }
}
@media (max-width: 440px) {
  #checks th:nth-child(3), #checks td:nth-child(3) { display: none; }
}
#view .ctx { stroke: var(--steel-400); stroke-width: .8; stroke-linejoin: round; }
#view .cage { fill: var(--steel-350); stroke: var(--steel-550); stroke-width: .6; }
#view .shield { fill: var(--x-b9c0c8, #b9c0c8); stroke: var(--steel-650); stroke-width: .6; }
#view .seal { fill: var(--steel-750); stroke: var(--ink); stroke-width: .6; }
#view .aarc { fill: none; stroke: var(--q); stroke-width: .9; }
.f.sel2 { grid-template-columns: minmax(0, 1fr); gap: 4px; }
.f.sel2 > label { grid-template-columns: minmax(0, 1fr); }
.f.sel2 > label span { white-space: normal; overflow: visible; }
#view .arrg { stroke: var(--load); stroke-width: 1.8; stroke-dasharray: 4 3; opacity: .5; fill: none; }
#view .arrgh { fill: var(--load); opacity: .5; }
#view .pill.load.ghost rect { stroke: color-mix(in srgb, var(--load) 35%, transparent); stroke-dasharray: 3 2; } #view .pill.load.ghost text { fill: var(--x-c0573a, #c0573a); font-weight: 500; }
/* duty condition names: renamed in the first cell, the type as a grey subtitle */
table.duty td.n { min-width: 150px; }
.br-nm { display: grid; line-height: 1.15; text-align: left; }
table.duty td input.br-name { width: 100%; min-width: 0; text-align: left; font-weight: 600; color: var(--text); border-color: transparent; background: transparent; padding: 2px 6px; margin-left: -6px; font-variant-numeric: normal; }
table.duty td input.br-name:hover { border-color: var(--line); }
table.duty td input.br-name:focus { border-color: var(--line-2); background: var(--surface); }
.br-nm small { font-size: 11px; color: var(--text-3); }
@media (max-width: 700px) { table.duty td.n { min-width: 110px; } }
table.duty tr.br-nmrow { display: none; }
@media (max-width: 700px) {
  table.duty tr.br-nmrow { display: table-row; }
  table.duty tr.br-nmrow td { padding-bottom: 0; border-bottom: 0; }
  table.duty th:first-child, table.duty td.n { display: none; }
  table.duty td, table.duty th { padding-left: 2px; padding-right: 2px; }
  table.duty td:last-child { padding-left: 0; padding-right: 0; }
  table.duty tr.br-nmrow td input.br-name { margin-left: 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-6e7177: #85827f; --x-8a4a8a: #c990c8; --x-b9c0c8: #44494f; --x-c0573a: #f1967c; --x-c9dcef: #2d3945;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --x-6e7177: #85827f; --x-8a4a8a: #c990c8; --x-b9c0c8: #44494f; --x-c0573a: #f1967c; --x-c9dcef: #2d3945;
  }
}
/* theme-auto:end */
