/* view.css - the board page. Its colours are Boardsheet's own tokens (css/design-tokens.css). */
:root {
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
}
:root {
  color-scheme: light;
}
:root[data-theme="dark"] {
  color-scheme: dark;
}
* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--mute) transparent;
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 2px;
  border: 2px solid var(--panel);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--mute);
}
::-webkit-scrollbar-corner {
  background: transparent;
}
html,
body {
  height: 100%;
  margin: 0;
}
body {
  background: var(--bg);
  color: var(--ink);
  font:
    14px/1.45 system-ui,
    "Segoe UI",
    Roboto,
    sans-serif;
  display: flex;
  flex-direction: column;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 18px; /* design-ok: imported Boardsheet scale */
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
h1 {
  font-size: 17px; /* design-ok: imported Boardsheet scale */
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.01em;
}
h1 small {
  font-weight: 400;
  color: var(--mute);
  margin-left: 8px;
  font-size: 13px; /* design-ok: imported Boardsheet scale */
}
.stats {
  display: flex;
  gap: 18px; /* design-ok: imported Boardsheet scale */
  margin-left: auto;
  align-items: center;
  flex-wrap: wrap;
}
.stat {
  display: flex;
  flex-direction: column;
  min-width: 74px;
}
.stat b {
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.stat span {
  font-size: 11px; /* design-ok: imported Boardsheet scale */
  color: var(--mute);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.bar {
  height: 4px;
  background: var(--soft);
  border-radius: 2px;
  margin-top: 3px; /* design-ok: imported Boardsheet scale */
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  background: var(--accent);
  width: 0;
}
.boards {
  display: flex;
  align-items: center;
  gap: 6px; /* design-ok: imported Boardsheet scale */
  font-size: 12px;
  color: var(--mute);
}
.boards input {
  width: 58px;
  padding: 4px 6px; /* design-ok: imported Boardsheet scale */
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--panel);
  font-variant-numeric: tabular-nums;
}
.btn {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 2px;
  padding: 5px 10px; /* design-ok: imported Boardsheet scale */
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover {
  border-color: var(--accent);
}
.btn.on {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.btn.small {
  padding: 3px 8px; /* design-ok: imported Boardsheet scale */
  font-size: 12px;
}
.btn.icon {
  padding: 5px 7px; /* design-ok: imported Boardsheet scale */
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn svg {
  width: 16px;
  height: 16px;
  display: block;
  pointer-events: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
kbd {
  font-family: var(--mono);
  font-size: 11px; /* design-ok: imported Boardsheet scale */
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0 5px; /* design-ok: imported Boardsheet scale */
  background: var(--soft);
  color: var(--ink);
}
.btn.on kbd {
  background: var(--kbd-on-bg);
  border-color: var(--kbd-on-line);
  color: var(--accent-ink);
}
main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(380px, var(--leftw, 56%)) 7px minmax(260px, 1fr);
  min-height: 0;
}
#grip {
  cursor: col-resize;
  background: var(--line);
  position: relative;
}
#grip:hover,
#grip.on {
  background: var(--accent);
}
#grip::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 50%;
  width: 3px;
  height: 28px;
  margin-top: -14px; /* design-ok: imported Boardsheet scale */
  border-radius: 2px;
  background: var(--mute);
  opacity: 0.6;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.menu {
  position: relative;
}
.menu .pop {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 260px;
  background: var(--panel);
  border: 1px solid var(--ink);
  border-radius: 2px;
  padding: 6px; /* design-ok: imported Boardsheet scale */
  z-index: 20;
  display: none;
}
.menu.open .pop {
  display: block;
}
.pop button {
  display: flex;
  width: 100%;
  gap: 14px; /* design-ok: imported Boardsheet scale */
  align-items: baseline;
  justify-content: space-between;
  border: 0;
  background: transparent;
  padding: 7px 10px; /* design-ok: imported Boardsheet scale */
  border-radius: 2px;
  cursor: pointer;
  text-align: left;
}
.pop button:hover {
  background: var(--soft);
}
.pop button small {
  color: var(--mute);
  font-family: var(--mono);
  font-size: 11px; /* design-ok: imported Boardsheet scale */
  white-space: nowrap;
}
.pop hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 5px 4px; /* design-ok: imported Boardsheet scale */
}
.pop .danger {
  color: var(--bad);
}
.pop h5 {
  margin: 6px 10px 3px; /* design-ok: imported Boardsheet scale */
  font-size: 11px; /* design-ok: imported Boardsheet scale */
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mute);
  font-weight: 600;
}
.pop p {
  margin: 4px 10px 8px; /* design-ok: imported Boardsheet scale */
  color: var(--mute);
  font-size: 12px;
}
.chip i {
  font-style: normal;
  opacity: 0.65;
  margin-left: 5px; /* design-ok: imported Boardsheet scale */
  font-variant-numeric: tabular-nums;
}
.card .big {
  cursor: copy;
}
.btn.go {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px; /* design-ok: imported Boardsheet scale */
}
.btn.go.on {
  color: var(--accent-ink);
}
.btn.go svg {
  width: 11px;
  height: 11px;
  fill: currentColor;
  stroke: none;
}
dialog {
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--panel);
  color: var(--ink);
  padding: 18px 22px; /* design-ok: imported Boardsheet scale */
  max-width: 440px;
}
dialog::backdrop {
  background: var(--scrim);
}
dialog h3 {
  margin: 0 0 10px; /* design-ok: imported Boardsheet scale */
  font-size: 16px;
}
dialog table {
  font-size: 13px; /* design-ok: imported Boardsheet scale */
}
dialog td {
  border: 0;
  padding: 4px 14px 4px 0; /* design-ok: imported Boardsheet scale */
}
dialog td:first-child {
  white-space: nowrap;
}
#toast {
  position: absolute;
  left: 50%;
  top: 52px;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  border-radius: 2px;
  padding: 4px 12px;
  font-size: 12px;
  z-index: 5;
  display: none;
}
.left,
.right {
  min-width: 0;
}
.left {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: var(--panel);
}
.tools {
  display: flex;
  gap: 8px;
  padding: 10px 14px; /* design-ok: imported Boardsheet scale */
  align-items: center;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
}
.tools input[type="search"] {
  flex: 1;
  min-width: 150px;
  padding: 6px 10px; /* design-ok: imported Boardsheet scale */
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--bg);
}
.chips {
  display: flex;
  gap: 5px; /* design-ok: imported Boardsheet scale */
  flex-wrap: wrap;
}
.chip {
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 2px 10px; /* design-ok: imported Boardsheet scale */
  font-size: 12px;
  cursor: pointer;
  background: var(--panel);
  color: var(--mute);
}
.chip.on {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}
.scroll {
  overflow: auto;
  flex: 1;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px; /* design-ok: imported Boardsheet scale */
}
thead th {
  position: sticky;
  top: 0;
  background: var(--panel);
  text-align: left;
  font-weight: 600;
  font-size: 11px; /* design-ok: imported Boardsheet scale */
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mute);
  padding: 8px 8px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  white-space: nowrap;
  z-index: 1;
}
thead th.num,
td.num {
  text-align: right;
}
tbody td {
  padding: 7px 8px; /* design-ok: imported Boardsheet scale */
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
tbody tr.row {
  cursor: pointer;
}
tbody tr.row:hover {
  background: var(--soft);
}
tbody tr.done {
  background: var(--ok-soft);
}
tbody tr.sel,
tbody tr.sel:hover {
  background: var(--sel-soft);
}
tbody tr.sel > td:first-child {
  border-left: 4px solid var(--hi);
  padding-left: 4px;
}
tbody tr.dnp td {
  color: var(--mute);
}
tbody tr.done td.refs {
  color: var(--ok);
}
td.num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
td.refs {
  font-family: var(--mono);
  font-size: 12px;
  min-width: 118px;
  max-width: 170px;
}
td .mpn {
  font-family: var(--mono);
  font-size: 12px;
}
td .sub {
  color: var(--mute);
  font-size: 11.5px; /* design-ok: imported Boardsheet scale */
}
.tag {
  display: inline-block;
  border-radius: 2px;
  padding: 0 6px; /* design-ok: imported Boardsheet scale */
  font-size: 11px; /* design-ok: imported Boardsheet scale */
  line-height: 17px;
  margin: 1px 3px 1px 0; /* design-ok: imported Boardsheet scale */
  background: var(--soft);
  color: var(--mute);
  white-space: nowrap;
}
.tag.dk {
  background: var(--accent-soft);
  color: var(--accent);
}
.tag.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.tag.ok {
  background: var(--ok-soft);
  color: var(--ok);
}
.pl {
  display: inline-block;
  min-width: 38px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0 5px; /* design-ok: imported Boardsheet scale */
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  background: var(--panel);
}
.pl.full {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: var(--ok);
}
tr.detail td {
  background: var(--bg);
  padding: 12px 16px 14px 44px; /* design-ok: imported Boardsheet scale */
}
.dgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}
.card {
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 9px 11px; /* design-ok: imported Boardsheet scale */
  background: var(--panel);
}
.card h4 {
  margin: 0 0 5px; /* design-ok: imported Boardsheet scale */
  font-size: 11px; /* design-ok: imported Boardsheet scale */
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mute);
  font-weight: 600;
}
.card .big {
  font-family: var(--mono);
  font-size: 13px; /* design-ok: imported Boardsheet scale */
}
.tiers {
  display: flex;
  gap: 10px; /* design-ok: imported Boardsheet scale */
  flex-wrap: wrap;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}
.tiers span.at {
  color: var(--accent);
  font-weight: 600;
}
.reflist {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.reflist .pl {
  font-family: var(--mono);
}
a {
  color: var(--accent);
}
.right {
  position: relative;
  min-height: 0;
  background: var(--canvas);
  display: flex;
  flex-direction: column;
}
.viewbar {
  display: flex;
  gap: 6px; /* design-ok: imported Boardsheet scale */
  padding: 8px 10px; /* design-ok: imported Boardsheet scale */
  align-items: center;
  flex-wrap: wrap;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 2;
  pointer-events: none;
}
.viewbar > * {
  pointer-events: auto;
}
.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
  background: var(--panel);
}
.seg button {
  border: 0;
  background: transparent;
  padding: 4px 11px; /* design-ok: imported Boardsheet scale */
  cursor: pointer;
}
.seg button.on {
  background: var(--accent);
  color: var(--accent-ink);
}
canvas {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
  cursor: grab;
  touch-action: none;
}
#cv3,
.right.v3 #cv {
  display: none;
}
.right.v3 #cv3 {
  display: block;
}
.right.v3 #layers,
.right.v3 #mode {
  display: none;
}
canvas.drag {
  cursor: grabbing;
}
#tip {
  position: fixed;
  pointer-events: none;
  background: var(--ink);
  color: var(--bg);
  padding: 4px 8px;
  border-radius: 2px;
  font-size: 12px;
  display: none;
  z-index: 9;
  max-width: 320px;
}
#status .pl {
  margin-left: 6px; /* design-ok: imported Boardsheet scale */
}
#status b {
  color: var(--ink);
}
#status {
  position: absolute;
  left: 10px;
  bottom: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 4px 10px; /* design-ok: imported Boardsheet scale */
  font-size: 12px;
  color: var(--mute);
  z-index: 2;
}
#guide {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 14px;
  background: var(--panel);
  border: 1px solid var(--ink);
  border-radius: 2px;
  padding: 12px 16px;
  z-index: 3;
  display: none;
  min-width: 340px;
  max-width: 92%;
}
#guide h3 {
  margin: 0 0 4px;
  font-size: 16px;
}
/* the Guide's head: what to grab big (value, how many), the line's place and how it is placed small above, a close x in the corner */
#guide .gx {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 2px;
  background: none;
  color: var(--mute);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
#guide .gx:hover {
  background: var(--soft);
  color: var(--ink);
}
#guide .gtop {
  padding-right: 30px; /* design-ok: imported Boardsheet scale */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#guide h3 .gval {
  font-size: 22px;
  font-weight: 600;
}
#guide h3 .gqty {
  font-size: 16px;
  font-weight: 600;
  color: var(--mute);
  margin-left: 4px;
}
#guide h3 .gdone {
  font-size: 14px;
  color: var(--ok);
  margin-left: 4px;
}
#guide .gfp {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#guide .gmpn {
  font-family: var(--mono);
}
#g-prev,
#g-next {
  min-width: 44px;
  justify-content: center;
  font-size: 16px;
}
@media (pointer: coarse) {
  #guide .gx {
    width: 40px;
    height: 40px;
  }
  #guide .row2 .btn {
    min-height: 40px;
  }
}
#guide .sub {
  color: var(--mute);
  font-size: 12px;
}
#guide .row2 {
  display: flex;
  gap: 8px;
  margin-top: 10px; /* design-ok: imported Boardsheet scale */
  align-items: center;
}
#guide .row2 #g-ok {
  flex: 1;
}
#netbox {
  position: absolute;
  right: 10px;
  top: 46px;
  width: 250px;
  max-width: calc(100% - 20px);
  max-height: 60%;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--ink);
  border-radius: 2px;
  padding: 10px 12px; /* design-ok: imported Boardsheet scale */
  z-index: 2;
  display: none;
}
#netbox h4 {
  margin: 0 0 4px;
  font-size: 14px;
  font-family: var(--mono);
  word-break: break-all;
}
#netbox .sub {
  color: var(--mute);
  font-size: 12px;
  margin-bottom: 6px; /* design-ok: imported Boardsheet scale */
}
.pin {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0 6px; /* design-ok: imported Boardsheet scale */
  margin: 2px 3px 2px 0; /* design-ok: imported Boardsheet scale */
  font-family: var(--mono);
  font-size: 11.5px; /* design-ok: imported Boardsheet scale */
  cursor: pointer;
  background: var(--panel);
  line-height: 19px;
}
.pin:hover {
  border-color: var(--accent);
}
.pin.on {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.pin b {
  font-weight: 600;
}
.pin span {
  color: var(--mute);
}
h2.sec {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mute);
  margin: 0;
  padding: 14px 14px 6px; /* design-ok: imported Boardsheet scale */
}
.files {
  display: flex;
  gap: 6px; /* design-ok: imported Boardsheet scale */
  flex-wrap: wrap;
  padding: 6px 14px 16px; /* design-ok: imported Boardsheet scale */
}
@media (max-width: 900px) {
  #grip {
    display: none;
  }
  main {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 46% minmax(0, 1fr);
  }
  .right {
    order: 1;
  }
  .left {
    order: 2;
    border-right: 0;
    border-top: 1px solid var(--line);
  }
  header {
    gap: 10px; /* design-ok: imported Boardsheet scale */
    padding: 10px 14px; /* design-ok: imported Boardsheet scale */
  }
  .stats {
    margin-left: 0;
    gap: 14px; /* design-ok: imported Boardsheet scale */
  }
}
@media (max-width: 700px) {
  html,
  body {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }
  header {
    flex-wrap: nowrap;
    gap: 8px;
    padding: 8px 10px; /* design-ok: imported Boardsheet scale */
  }
  h1 {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
  }
  h1 small,
  .stat,
  .boards,
  #m-files,
  #layers,
  #keys2 {
    display: none;
  }
  .stats {
    flex-wrap: nowrap;
    gap: 8px;
    flex: none;
  }
  .stat.keep {
    display: flex;
    min-width: 62px;
  }
  .stat.keep b {
    font-size: 14px;
  }
  .viewbar {
    padding: 6px; /* design-ok: imported Boardsheet scale */
    gap: 5px; /* design-ok: imported Boardsheet scale */
  }
  .seg button {
    padding: 6px 10px; /* design-ok: imported Boardsheet scale */
  }
  .btn.small {
    padding: 6px 9px; /* design-ok: imported Boardsheet scale */
  }
  .tools {
    padding: 8px 10px; /* design-ok: imported Boardsheet scale */
    gap: 6px; /* design-ok: imported Boardsheet scale */
  }
  .tools input[type="search"] {
    min-width: 0;
    flex: 1 1 100%;
    padding: 8px 10px; /* design-ok: imported Boardsheet scale */
    font-size: 16px;
  }
  .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    width: 100%;
    scrollbar-width: none;
  }
  .chips::-webkit-scrollbar {
    display: none;
  }
  .chip {
    white-space: nowrap;
    padding: 4px 11px; /* design-ok: imported Boardsheet scale */
    flex: none;
  }
  .c-bought,
  .c-n,
  .c-fp,
  .c-qty,
  .c-unit,
  .c-cost,
  .c-src {
    display: none;
  }
  tbody td {
    padding: 10px 8px; /* design-ok: imported Boardsheet scale */
  }
  td.refs {
    min-width: 0;
    max-width: none;
  }
  td .mpn {
    overflow-wrap: anywhere;
  }
  td.refs {
    width: 36%;
  }
  .pl {
    min-width: 46px;
    padding: 3px 7px; /* design-ok: imported Boardsheet scale */
    font-size: 13px; /* design-ok: imported Boardsheet scale */
  }
  tr.detail td {
    padding: 10px; /* design-ok: imported Boardsheet scale */
  }
  #extra td {
    overflow-wrap: anywhere;
  }
  #extra th:nth-child(3),
  #extra td:nth-child(3) {
    display: none;
  }
  .scroll {
    overflow-x: hidden;
  }
  #status {
    left: 6px;
    right: 6px;
    bottom: 6px;
    font-size: 13px; /* design-ok: imported Boardsheet scale */
  }
  #guide {
    min-width: 0;
    width: calc(100% - 12px);
    bottom: 6px;
    padding: 10px 12px; /* design-ok: imported Boardsheet scale */
  }
  #guide kbd {
    display: none;
  }
  #netbox {
    top: auto;
    bottom: 44px;
    left: 6px;
    right: 6px;
    width: auto;
    max-height: 40%;
  }
  #tip {
    display: none !important;
  }
  .menu .pop {
    position: fixed;
    left: 8px;
    right: 8px;
    top: 50px;
    min-width: 0;
  }
}
@media print {
  .right,
  .tools,
  .viewbar,
  .btn,
  .files {
    display: none !important;
  }
  main {
    display: block;
  }
  .scroll {
    overflow: visible;
  }
  body {
    background: var(--paper-white);
  }
}
/* a BOM row: the package under the value, not a column of its own */
.c-fp {
  display: none;
}
.fp2 {
  display: block;
  overflow-wrap: anywhere;
}
#rows td.c-value {
  overflow-wrap: anywhere;
  min-width: 120px;
}
@media (max-width: 700px) {
  .c-mpn {
    display: none;
  }
  #rows td.c-value {
    min-width: 0;
  }
}
/* the mark-placed button by the part tapped */
#qmark {
  position: absolute;
  z-index: 3;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px; /* design-ok: imported Boardsheet scale */
  padding: 7px 12px; /* design-ok: imported Boardsheet scale */
  border-radius: 2px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font:
    600 13px/1.1 system-ui,
    "Segoe UI",
    sans-serif;
  cursor: pointer;
  white-space: nowrap;
  touch-action: manipulation;
}
#qmark[hidden] {
  display: none;
}
#qmark small {
  font-weight: 500;
  opacity: 0.8;
  font-size: 11.5px; /* design-ok: imported Boardsheet scale */
}
#qmark:active {
  transform: translateX(-50%) scale(0.96);
}
/* Placement mode: the board alone, the Guide in a strip of its own beside it (below it on a phone held upright), Done in the bar */
#place-x {
  display: none;
}
#place-btn svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  vertical-align: -2px;
  margin-right: 4px;
}
html.placing body > header,
html.placing main > .left,
html.placing #grip,
html.placing #mode,
html.placing #layers,
html.placing #place-btn,
html.placing #guide-btn,
html.placing #keys2,
html.placing #status {
  display: none !important;
}
html.placing #place-x {
  display: inline-flex;
}
html.placing body {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
html.placing main {
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) !important;
}
html.placing .right {
  padding-right: 292px; /* design-ok: imported Boardsheet scale */
}
html.placing #guide {
  left: auto;
  right: 8px;
  top: 8px;
  bottom: auto;
  max-height: calc(100% - 16px);
  transform: none;
  width: 276px;
  min-width: 0;
  padding: 10px 12px; /* design-ok: imported Boardsheet scale */
  overflow-y: auto;
  box-sizing: border-box;
}
html.placing #guide h3 {
  font-size: 16px;
  margin: 4px 0;
}
html.placing #guide kbd {
  display: none;
}
html.placing #guide .row2 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px; /* design-ok: imported Boardsheet scale */
  margin-top: 8px;
}
html.placing #guide .row2 .btn {
  justify-content: center;
  min-width: 0;
  padding-top: 9px; /* design-ok: imported Boardsheet scale */
  padding-bottom: 9px; /* design-ok: imported Boardsheet scale */
}
html.placing #g-ok {
  grid-column: 1/-1;
  min-width: 92px;
}
@media (max-width: 599px) {
  html.placing .right {
    padding-right: 0;
    padding-bottom: 238px; /* design-ok: imported Boardsheet scale */
  }
  html.placing #guide {
    top: auto;
    bottom: 8px;
    left: 8px;
    width: auto;
    height: 224px;
  }
  html.placing #guide .row2 {
    grid-template-columns: 1.6fr 0.8fr 1fr 1fr;
  }
  html.placing #g-ok {
    grid-column: auto;
  }
}
@media (max-height: 420px) {
  html.placing .right {
    padding-right: 236px; /* design-ok: imported Boardsheet scale */
  }
  html.placing #guide {
    width: 222px;
  }
}
/* the Guide: Placed the same width marked or not (the buttons beside it never shift); one button per part, the part in hand outlined */
#g-ok {
  min-width: 156px;
  justify-content: center;
}
@media (max-width: 700px) {
  #g-ok {
    min-width: 92px;
  }
}
#guide .grefs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px; /* design-ok: imported Boardsheet scale */
}
#guide .gref {
  font: 600 12px var(--mono);
  padding: 4px 8px;
  min-width: 40px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  touch-action: manipulation;
}
#guide .gref.act {
  outline: 2px solid var(--hi);
  outline-offset: 1px;
}
/* placed, the same everywhere (a BOM line's count, a line's parts, the Guide, the button by the part): green fill, green
   border, a tick - never colour alone; some placed: a green outline; to do: the filled accent of an action */
.pl.some {
  color: var(--ok);
  border-color: var(--ok);
}
.pl.full,
#guide .gref.done,
#qmark.done,
#g-ok.done {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: var(--ok);
  font-weight: 600;
}
#qmark.done small,
#g-ok.done kbd {
  color: var(--ok);
}
/* touch: targets big enough for a finger, no hover left stuck after a tap */
@media (pointer: coarse) {
  #guide .gref {
    min-height: 36px;
    min-width: 48px;
    padding: 6px 10px; /* design-ok: imported Boardsheet scale */
    font-size: 13px; /* design-ok: imported Boardsheet scale */
  }
  .pl {
    min-height: 30px;
    line-height: 22px;
  }
  #qmark {
    min-height: 40px;
    padding: 8px 14px; /* design-ok: imported Boardsheet scale */
  }
}
@media (hover: none) {
  .btn:hover {
    border-color: var(--line);
  }
  .btn.on:hover {
    border-color: var(--accent);
  }
}
