/* Chain of Command — transmission strip (HQ) and order assembly (field).
 * Tiles are stamped plates on a slotted teletype tape. Variable colours (.tpl-cell.var.c-*)
 * come from style.css; only size/position is tuned here. */

/* ============================================================ shared tile cell sizing */
.strip-tray .tpl-cell,
.strip-board .tpl-cell,
.asm .tpl-cell,
.strip-pop .tpl-cell,
.strip-ghost .tpl-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 30px;
  height: 30px;
  padding: 0 4px;
  font-size: 18px;
  line-height: 1;
  margin: 0;
  vertical-align: middle;
}
.strip-board .tpl-cell.lit,
.strip-tray .tpl-cell.lit,
.asm .tpl-cell.lit,
.strip-ghost .tpl-cell.lit {
  font-family: var(--f-mono);
  font-weight: 700;
  color: var(--ink);
}
.tpl-cell.strip-broken {
  background: repeating-linear-gradient(45deg, #6b6450 0 4px, #57513f 4px 8px);
  color: var(--paper);
}

/* ============================================================ supply tray */
.strip-tray {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  margin: 0 0 12px;
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(0, 0, 0, 0.1)),
    repeating-linear-gradient(90deg, var(--olive-800) 0 46px, #2c3520 46px 48px);
  border: 1px solid var(--olive-900);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), inset 0 -2px 4px rgba(0, 0, 0, 0.2);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
/* the tag sits beside its items; when the column is too narrow the items wrap below it */
.strip-tray-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 6px 10px;
  min-width: 0;
}
.strip-tray-tag {
  flex: 0 0 56px;
  padding-top: 12px;
  font: 10px/1 var(--f-stencil);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--khaki-dim);
  opacity: 0.85;
}
.strip-tray-items {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 180px;
}
.strip-tray-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  max-width: 100%;
  box-sizing: border-box;
  padding: 3px 8px;
  border: 1px solid #00000055;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--paper), var(--paper-2));
  color: var(--ink);
  font: 13px/1 var(--f-ui);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: 0 1px 0 #00000040, inset 0 1px 0 #ffffff70;
  transition: transform 0.08s, box-shadow 0.08s;
  -webkit-touch-callout: none;
}
.strip-tray-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 0 #00000040, 0 0 0 2px #c9a24a55, inset 0 1px 0 #ffffff70;
}
.strip-tray-item:focus-visible { outline: 2px solid var(--lamp); outline-offset: 2px; }
.strip-tray-item:active { cursor: grabbing; transform: translateY(1px); box-shadow: 0 1px 0 #00000040; }
.strip-tray-src { padding: 3px 4px; }
.strip-tray-name { white-space: nowrap; }

/* tools: riveted brass plates */
.strip-tool {
  background:
    radial-gradient(circle at 5px 5px, #7a5f22 1.3px, transparent 1.8px),
    radial-gradient(circle at calc(100% - 5px) 5px, #7a5f22 1.3px, transparent 1.8px),
    radial-gradient(circle at 5px calc(100% - 5px), #7a5f22 1.3px, transparent 1.8px),
    radial-gradient(circle at calc(100% - 5px) calc(100% - 5px), #7a5f22 1.3px, transparent 1.8px),
    linear-gradient(180deg, #e2c472, var(--brass) 55%, #a8822f);
  border-color: #6d5420;
  color: #2b220c;
  padding: 3px 12px;
}
.strip-tool-icon {
  font: 15px/1 var(--f-stencil);
  min-width: 18px;
  text-align: center;
}
/* every locked tool folds into one quiet chip */
.strip-locked-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  max-width: 100%;
  box-sizing: border-box;
  padding: 4px 10px;
  border: 1px dashed #a89d7866;
  border-radius: 14px;
  background: #0000001f;
  color: var(--khaki-dim);
  font: 12px/1.15 var(--f-type);
  text-align: left;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.strip-locked-chip:hover,
.strip-locked-chip.open { color: var(--khaki); border-color: #a89d78aa; background: #00000033; }
.strip-locked-chip:focus-visible { outline: 2px solid var(--lamp); outline-offset: 2px; }
.strip-locked-chip .strip-lock { flex: 0 0 auto; width: 9px; height: 11px; color: currentColor; opacity: 0.8; }
.strip-locked-name {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border: 1px solid #a89d7833;
  border-radius: 3px;
  color: #a89d7899;
  font: 11px/1 var(--f-ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: default;
}
.strip-locked-name .strip-tool-icon { font-size: 12px; min-width: 0; }

/* hover tip (positioned by strip.js; fixed so scrolling columns never clip it) */
.strip-tip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 9000;
  width: max-content;
  max-width: min(280px, calc(100vw - 12px));
  box-sizing: border-box;
  padding: 8px 10px;
  font: 13px/1.35 var(--f-type);
  letter-spacing: 0;
  text-transform: none;
  white-space: pre-line;
  text-align: left;
  color: var(--ink);
  background: var(--paper-bg, var(--paper));
  background-color: var(--paper);
  border: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: 3px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-3px);
  transition: opacity 0.15s, transform 0.15s, visibility 0s 0.15s;
}
.strip-tip.show { opacity: 1; visibility: visible; transform: none; transition: opacity 0.15s, transform 0.15s; }
body.is-dragging .strip-tip { display: none; }
@media (hover: none) {
  .strip-tip { display: none; }
}
.strip-new {
  position: absolute;
  top: -7px;
  right: -6px;
  padding: 2px 4px 1px;
  font: normal 9px/1 var(--f-stencil);
  letter-spacing: 0.06em;
  color: var(--paper);
  background: var(--red);
  border-radius: 2px;
  transform: rotate(6deg);
  box-shadow: 0 1px 2px #0008;
  animation: strip-new-pulse 1.6s ease-in-out infinite;
}
@keyframes strip-new-pulse { 50% { transform: rotate(6deg) scale(1.12); } }

/* ============================================================ the strip: a slotted teletype tape on a rail */
.strip-board {
  position: relative;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  padding: 8px;
  border-radius: 6px;
  background: linear-gradient(180deg, #1a2013, var(--olive-900));
  border: 1px solid #0d1009;
  box-shadow: inset 0 2px 5px #0007;
}
.strip-rail {
  position: relative;
  min-width: 0;
}
.strip-lane {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: flex-start;
  gap: 10px 6px;
  min-width: 0;
}
.strip-root {
  min-height: 92px;
  padding: 24px 12px;
  border-radius: 3px;
  background:
    radial-gradient(circle at 9px 9px, #1b2013 3px, #00000033 3.6px, transparent 4.2px) 0 0 / 18px 18px repeat-x,
    radial-gradient(circle at 9px 9px, #1b2013 3px, #00000033 3.6px, transparent 4.2px) 0 100% / 18px 18px repeat-x,
    repeating-linear-gradient(90deg, transparent 0 35px, #8a7d5626 35px 36px),
    linear-gradient(180deg, var(--paper-2), var(--paper) 18%, var(--paper) 82%, var(--paper-2));
  box-shadow: 0 0 0 1px #00000044, 0 2px 0 #0004;
  transition: box-shadow 0.15s;
}
.strip-root.strip-lane-hot { box-shadow: 0 0 0 2px var(--brass), 0 2px 0 #0004; }
.strip-empty {
  flex: 1 1 100%;
  text-align: center;
  font: 15px/1.3 var(--f-type);
  color: #7d735a;
  padding: 8px 4px;
  border: 2px dashed #a89d7877;
  border-radius: 4px;
  pointer-events: none;
}
.strip-lane-empty {
  font: 11px/1 var(--f-type);
  color: #8a7f60;
  padding: 0 6px;
  white-space: nowrap;
  pointer-events: none;
}
.strip-drop {
  /* placed by strip.js over the board; takes no room in the rows */
  position: absolute;
  z-index: 3;
  width: 4px;
  border-radius: 2px;
  background: var(--amber);
  box-shadow: 0 0 8px var(--lamp);
  pointer-events: none;
}

/* ---- a tile on the tape */
.strip-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  max-width: 100%;
  box-sizing: border-box;
  padding: 4px;
  border-radius: 4px;
  background: linear-gradient(180deg, #fbf5e2, var(--paper-2));
  border: 1px solid #00000047;
  box-shadow: 0 1px 0 #00000040, inset 0 1px 0 #ffffffa0;
  color: var(--ink);
  cursor: grab;
  -webkit-touch-callout: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: box-shadow 0.12s, outline-color 0.12s, opacity 0.12s;
}
.strip-item:active { cursor: grabbing; }
.strip-item.dragging { opacity: 0.35; }
.strip-item.pressing { transition: transform 0.45s ease-in; transform: scale(0.94); }
.strip-item.active {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px #e0a03033, 0 0 14px #ffd25790, 0 1px 0 #00000040;
  z-index: 1;
}
.strip-item.strip-not-target {
  outline: 2px dashed var(--red);
  outline-offset: 2px;
}
.strip-lit { background: linear-gradient(180deg, #f4ecd3, #d9cca5); }
.strip-lit .tpl-cell.lit { background: transparent; border: 0; box-shadow: none; }

/* remove ✕ */
.strip-del {
  position: absolute;
  top: -8px;
  right: -8px;
  z-index: 2;
  width: 18px;
  height: 18px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #00000080;
  background: var(--red);
  color: var(--paper);
  font: 10px/1 var(--f-ui);
  cursor: pointer;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.12s, transform 0.12s;
}
.strip-item:hover > .strip-del,
.strip-item > .strip-del:focus-visible { opacity: 1; transform: scale(1); }
/* hovering a tile inside a REPEAT/IF shows only that tile's ✕, not the container's too */
.strip-item:hover:has(.strip-item:hover) > .strip-del:not(:focus-visible) { opacity: 0; transform: scale(0.7); }
body.is-dragging .strip-del { display: none; }
@media (hover: none) {
  .strip-del { opacity: 0.7; transform: scale(0.8); }
}

/* ¬ corner: invisible until the tile is hovered/focused; a small red mark once active */
.strip-not,
.asm-not {
  position: absolute;
  left: -7px;
  bottom: -7px;
  z-index: 2;
  width: 18px;
  height: 18px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #00000055;
  background: var(--paper);
  color: #6f6448;
  font: 700 13px/1 var(--f-mono);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.75);
  transition: opacity 0.12s, transform 0.12s;
}
@media (hover: hover) {
  .strip-item:hover > .strip-not,
  .asm-reader:hover .asm-not { opacity: 1; pointer-events: auto; transform: none; }
}
.strip-not:focus-visible,
.asm-not:focus-visible { opacity: 1; pointer-events: auto; transform: none; }
.strip-not:hover,
.asm-not:hover { color: var(--red); border-color: var(--red); }
.strip-not:focus-visible,
.asm-not:focus-visible { outline: 2px solid var(--lamp); outline-offset: 1px; }
.strip-not.on,
.asm-not.on {
  opacity: 1;
  pointer-events: auto;
  transform: none;
  background: var(--red);
  border-color: #5c1f13;
  color: var(--paper);
  font-size: 12px;
}
.strip-not:disabled,
.asm-not:disabled { cursor: default; }
body.is-dragging .strip-not:not(.on) { opacity: 0; }
.strip-src.negated .tpl-cell { box-shadow: inset 0 0 0 2px var(--red); }
.strip-pop-not.on { background: var(--red); color: var(--paper); }
.asm-flippable { cursor: pointer; }

/* grip */
.strip-grip { display: inline-flex; flex-direction: column; gap: 2px; padding: 0 2px; opacity: 0.55; }
.strip-grip i { display: block; width: 8px; height: 2px; background: currentColor; border-radius: 1px; }
.strip-kw {
  font: 12px/1 var(--f-stencil);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.strip-kw-soft { font: 13px/1 var(--f-type); text-transform: none; opacity: 0.85; }

/* steppers */
.strip-step {
  display: inline-flex;
  align-items: stretch;
  height: 26px;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid #00000055;
  background: var(--olive-900);
  box-shadow: inset 0 1px 2px #0008;
}
.strip-step button {
  width: 22px;
  padding: 0;
  border: 0;
  background: linear-gradient(180deg, var(--olive-600), var(--olive-700));
  color: var(--khaki);
  font: 15px/1 var(--f-ui);
  cursor: pointer;
}
.strip-step button:hover { background: var(--olive-500); }
.strip-step button:active { background: var(--olive-800); }
.strip-step b {
  min-width: 28px;
  padding: 0 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 14px/1 var(--f-mono);
  color: var(--lamp);
  text-shadow: 0 0 5px #ffd25780;
}

/* ---- REPEAT: an inline bracket */
.strip-rep {
  padding: 3px 4px;
  gap: 4px;
  flex-wrap: wrap;
  background:
    linear-gradient(90deg, var(--olive-600) 0 6px, transparent 6px calc(100% - 6px), var(--olive-600) calc(100% - 6px)),
    #46522f26;
  border: 2px solid #46522fcc;
  border-left-width: 0;
  border-right-width: 0;
  border-radius: 2px;
  box-shadow: none;
  color: var(--olive-800);
}
.strip-rep-head,
.strip-rep-tail {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 4px 0 8px;
  align-self: stretch;
}
.strip-rep-tail { padding: 0 8px 0 2px; }
.strip-rep-body {
  min-height: 40px;
  min-width: 46px;
  padding: 3px 4px;
  border-radius: 3px;
  background: #fffaea99;
  box-shadow: inset 0 1px 2px #0002;
  flex: 0 1 auto;
}
.strip-rep-body.strip-lane-hot,
.strip-if-lane.strip-lane-hot { box-shadow: inset 0 0 0 2px var(--amber); }

/* ---- IF: a boxed junction with two lanes */
.strip-if {
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 5px 6px 6px;
  background: linear-gradient(180deg, #e4ebe2, #cbd7cd);
  border: 2px solid var(--teal);
  color: #183b38;
}
.strip-if-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}
.strip-if-var,
.strip-if-set,
.strip-mode,
.asm-vote-btn,
.asm-mode {
  border: 1px solid #00000059;
  border-radius: 3px;
  cursor: pointer;
}
.strip-if-var { padding: 1px; background: #fff8; line-height: 0; }
.strip-if-var .tpl-cell { min-width: 24px; height: 24px; font-size: 15px; }
.strip-if-set {
  padding: 4px 7px;
  background: var(--paper);
  color: var(--ink);
  font: 14px/1 var(--f-mono);
}
.strip-if-set.unset,
.asm-vote-btn.unset { color: var(--red); font-style: italic; }
.strip-if-lanes { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.strip-if-branch {
  display: flex;
  align-items: stretch;
  gap: 4px;
  min-width: 0;
}
.strip-if-tag {
  flex: 0 0 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 11px/1 var(--f-stencil);
  letter-spacing: 0.06em;
  border-radius: 3px;
  color: var(--paper);
}
.strip-if-then > .strip-if-tag { background: var(--green); }
.strip-if-else > .strip-if-tag { background: var(--red); }
.strip-if-lane {
  flex: 1 1 auto;
  min-height: 40px;
  min-width: 60px;
  padding: 3px 4px;
  border-radius: 3px;
  background:
    radial-gradient(circle at 5px 50%, #2f6f6a40 1.6px, transparent 2px) 0 0 / 10px 100% repeat-x,
    #fffaea;
  box-shadow: inset 0 1px 3px #0003;
}

/* ---- PARITY / CHECK / SEAL: stamped metal plates */
.strip-par,
.strip-chk,
.strip-seal {
  gap: 5px;
  padding: 4px 8px 4px 6px;
  color: #241c08;
  border-color: #5e481a;
  background:
    radial-gradient(circle at 4px 4px, #6d5420 1.2px, transparent 1.7px),
    radial-gradient(circle at calc(100% - 4px) calc(100% - 4px), #6d5420 1.2px, transparent 1.7px),
    linear-gradient(180deg, #e8cd7f, var(--brass) 60%, #9f7b2c);
}
.strip-chk {
  color: #0f1b20;
  border-color: #33464f;
  background:
    radial-gradient(circle at 4px 4px, #2c3b42 1.2px, transparent 1.7px),
    radial-gradient(circle at calc(100% - 4px) calc(100% - 4px), #2c3b42 1.2px, transparent 1.7px),
    linear-gradient(180deg, #a7bcc6, var(--steel) 70%, #485c66);
}
.strip-seal {
  color: var(--paper);
  border-color: #5c1f13;
  background:
    radial-gradient(circle at 30% 30%, #ffffff30, transparent 55%),
    linear-gradient(180deg, #c9583f, var(--red) 60%, #7e2c1c);
}
.strip-plate-face { display: inline-flex; align-items: center; gap: 4px; }
.strip-plate-sym {
  font: 20px/1 var(--f-stencil);
  min-width: 18px;
  text-align: center;
  text-shadow: 0 1px 0 #ffffff55;
}
.strip-seal .strip-plate-sym { font-size: 17px; text-shadow: 0 1px 0 #0006; }
.strip-mode {
  padding: 3px 5px;
  font: 11px/1 var(--f-mono);
  background: var(--olive-900);
  color: var(--lamp);
}
.strip-mode:hover { box-shadow: 0 0 0 2px #ffd25766; }
.strip-chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  max-width: 96px;
  padding: 2px;
  border-radius: 3px;
  background: #00000026;
  box-shadow: inset 0 1px 2px #0005;
}
.strip-chips .tpl-cell { min-width: 15px; height: 15px; font-size: 10px; padding: 0 1px; border-radius: 2px; }
.strip-chips.unset { font: 11px/1.3 var(--f-type); color: inherit; opacity: 0.75; padding: 2px 5px; }

/* ============================================================ drag ghost + popover bits */
.drag-ghost.strip-ghost {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 9999;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--paper), var(--paper-2));
  color: var(--ink);
  border: 1px solid #0006;
  font: 14px/1 var(--f-stencil);
  letter-spacing: 0.04em;
  box-shadow: 0 6px 14px #0007;
  white-space: nowrap;
}
.drag-ghost.strip-ghost.trash {
  background: linear-gradient(180deg, #d0624a, var(--red));
  color: var(--paper);
  border-color: #5c1f13;
}
.drag-ghost.strip-ghost.trash::before { content: none; }
.drag-ghost.strip-ghost.trash::after { content: '✕ scrap'; font: 11px/1 var(--f-ui); text-transform: uppercase; margin-left: 4px; }
.strip-ghost-tile { display: inline-flex; align-items: center; gap: 4px; }

.strip-pop .strip-pop-vars .pop-tile { padding: 3px; line-height: 0; }
.strip-pop .strip-pop-vars .pop-tile .tpl-cell { min-width: 26px; height: 26px; font-size: 16px; }
.strip-pop .strip-pop-vars .pop-tile:not(.on) .tpl-cell { opacity: 0.45; filter: grayscale(0.6); }
.strip-pop-all {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 5px;
  border: 1px solid #0005;
  border-radius: 3px;
  background: var(--olive-600);
  color: var(--khaki);
  font: 12px/1 var(--f-ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.strip-pop-all:hover { background: var(--olive-500); }

/* multi-select pickers: paintable grid + quick row + VOTE helpers */
.strip-multi { touch-action: none; user-select: none; -webkit-user-select: none; }
.strip-multi .pop-tile { cursor: pointer; }
.strip-pop-pos { grid-template-columns: repeat(8, minmax(32px, auto)); }
.strip-quick { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.strip-quick-btn,
.strip-stride-go,
.strip-suggest {
  padding: 4px 8px;
  border: 1px solid #00000040;
  border-radius: 3px;
  background: #00000010;
  color: #4a4535;
  font: 11px/1 var(--f-ui);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.strip-quick-btn:hover,
.strip-stride-go:hover,
.strip-suggest:hover { background: #46522f26; color: var(--ink); border-color: #00000066; }
.strip-quick-btn:focus-visible,
.strip-stride-go:focus-visible,
.strip-suggest:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; }
.strip-suggest {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 6px 8px;
  text-align: left;
  text-transform: none;
  letter-spacing: 0;
  font: 13px/1.25 var(--f-type);
  border-style: dashed;
  border-color: #7a5512aa;
  background: #ffd25722;
}
.strip-suggest b { font: 13px/1 var(--f-mono); color: #5c3f0a; }
.strip-stride {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #8a7d5666;
  font: 13px/1 var(--f-type);
  color: #4a4535;
}
.strip-stride .strip-step { height: 24px; }
.strip-stride .strip-step b { min-width: 30px; font-size: 13px; }
.strip-stride-go { margin-left: auto; background: var(--olive-600); color: var(--khaki); border-color: #0006; }
.strip-stride-go:hover { background: var(--olive-500); color: var(--paper); }
.strip-pop-hint { margin-top: 8px; font: 11px/1.2 var(--f-type); color: #7d735a; }
@media (hover: none) { .strip-pop-hint { display: none; } }

/* ============================================================ field: order assembly */
.asm {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  padding: 10px 12px 12px;
  border-radius: 6px;
  background:
    repeating-linear-gradient(0deg, transparent 0 23px, #8a7d5622 23px 24px),
    linear-gradient(180deg, var(--paper), var(--paper-2));
  border: 1px solid #0005;
  box-shadow: 0 1px 0 #0004, inset 0 0 0 3px #ffffff1a;
  color: var(--ink);
  transition: box-shadow 0.15s, outline-color 0.15s;
}
.asm.active {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px #e0a03033, 0 0 16px #ffd25780;
}
.asm-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding-bottom: 6px;
  border-bottom: 1px dashed #8a7d5699;
}
.asm-tag {
  flex: 0 0 auto;
  font: 11px/1 var(--f-stencil);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6f6448;
}
.asm-preview-cells { display: flex; flex-wrap: wrap; gap: 3px; min-width: 0; }
.asm-preview-cells .tpl-cell { min-width: 22px; height: 22px; font-size: 13px; padding: 0 2px; }
.asm-readers {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 10px;
  min-width: 0;
}
.asm-reader {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 78px;
  padding: 8px 6px 6px;
  border-radius: 4px;
  background: linear-gradient(180deg, #fbf5e2, #e8dcb8);
  border: 1px solid #00000047;
  box-shadow: 0 1px 0 #0003, inset 0 1px 0 #fff9;
}
.asm-reader::before {
  /* punched index hole */
  content: '';
  position: absolute;
  top: 3px;
  left: 50%;
  width: 14px;
  height: 3px;
  margin-left: -7px;
  border-radius: 2px;
  background: #00000033;
}
.asm-reader-top { position: relative; line-height: 0; }
.asm-reader-top .tpl-cell { min-width: 34px; height: 34px; font-size: 20px; }
.asm-negated .asm-reader-top .tpl-cell { box-shadow: inset 0 0 0 2px var(--red); }
.asm-arrow { font-size: 9px; line-height: 1; color: #8a7d56; }
.asm-ctl { display: flex; justify-content: center; }
.asm-vote-btn {
  padding: 4px 6px;
  background: var(--olive-900);
  color: var(--lamp);
  font: 13px/1 var(--f-mono);
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.asm-vote-btn .asm-kw { font: 11px/1 var(--f-stencil); color: var(--khaki); letter-spacing: 0.06em; }
.asm-mode {
  margin-top: 2px;
  padding: 2px 6px;
  background: transparent;
  color: #5d5540;
  font: 10px/1 var(--f-ui);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.asm-mode::before { content: '⇄ '; }
.asm-mode:hover { background: #46522f26; color: var(--ink); }
.asm-vote { background: linear-gradient(180deg, #f1ead0, #d9d3b0); }
.asm .asm-not { left: -9px; bottom: -7px; }

/* ============================================================ narrow screens */
@media (max-width: 560px) {
  .strip-tray { padding: 8px 10px; }
  .strip-tray-tag { flex-basis: 100%; padding-top: 0; }
  .strip-tray-item { min-height: 36px; font-size: 12px; }
  .strip-tool { padding: 3px 10px; }
  .strip-root { padding: 20px 8px; }
  .strip-item { min-height: 38px; }
  .strip-rep-body,
  .strip-if-lane { min-width: 40px; }
  .asm-reader { min-width: 70px; }
}

/* ============================================================ multi-selection (shift / ctrl-click) */
.strip-item.selected {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
  transform: translateY(-2px);
  box-shadow: 0 0 0 4px #e0a0302e, 0 5px 9px #00000059, inset 0 1px 0 #ffffffa0;
  z-index: 1;
}
.strip-item.selected.dragging { transform: none; }
.drag-ghost.strip-ghost.strip-ghost-multi {
  box-shadow:
    4px 4px 0 -1px var(--paper-2), 4px 4px 0 0 #0000006b,
    8px 8px 0 -2px #d3c69f, 8px 8px 0 -1px #00000059,
    0 10px 18px #0007;
}
.drag-ghost.strip-ghost.strip-ghost-multi.trash {
  box-shadow:
    4px 4px 0 -1px #a5402c, 4px 4px 0 0 #5c1f13,
    8px 8px 0 -2px #8c3523, 8px 8px 0 -1px #5c1f13,
    0 10px 18px #0007;
}
.strip-ghost-part { display: inline-flex; align-items: center; }
.strip-ghost-count,
.drag-ghost .ghost-count {
  display: inline-block;
  margin-left: 2px;
  padding: 3px 6px 2px;
  border-radius: 9px;
  background: var(--amber);
  color: #1d1705;
  font: 600 11px/1 var(--f-ui);
  font-style: normal;
  letter-spacing: 0.04em;
  rotate: 0deg;
  box-shadow: 0 1px 0 #0007;
}
.drag-ghost.strip-ghost.trash .strip-ghost-count { background: var(--paper); color: var(--red); }

/* floating "3 selected · drag to move · …" chip (both editors), centred under its panel */
.sel-chip {
  position: fixed;
  z-index: 800;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 24px);
  box-sizing: border-box;
  padding: 5px 5px 5px 13px;
  border-radius: 999px;
  border: 1px solid #e0a030b0;
  background: #161a10f2;
  color: var(--khaki);
  font: 12.5px/1.2 var(--f-ui);
  letter-spacing: 0.03em;
  white-space: nowrap;
  box-shadow: 0 8px 20px #000a, 0 0 0 3px #e0a0301c;
  animation: sel-chip-in 0.16s ease-out;
}
.sel-chip[hidden] { display: none; }
.sel-chip b { color: var(--amber); font-weight: 600; }
.sel-chip-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sel-chip button {
  flex: none;
  height: 24px;
  border-radius: 12px;
  border: 1px solid #ffffff26;
  background: #ffffff12;
  color: var(--khaki);
  font: 12px/1 var(--f-ui);
  cursor: pointer;
}
.sel-chip button[hidden] { display: none; }
.sel-chip-btn { padding: 0 10px; }
.sel-chip-x { width: 24px; padding: 0; }
.sel-chip button:hover,
.sel-chip button:focus-visible { border-color: var(--amber); color: var(--lamp); }
body.is-dragging .sel-chip { opacity: 0.55; pointer-events: none; }
@keyframes sel-chip-in { from { opacity: 0; transform: translate(-50%, 6px); } }
@media (prefers-reduced-motion: reduce) { .sel-chip { animation: none; } }

/* one-line how-to under the strip / plate stack */
.sel-hint {
  margin: 6px 4px 0;
  font: 11px/1.3 var(--f-ui);
  letter-spacing: 0.03em;
  color: var(--khaki-dim);
  opacity: 0.7;
  text-align: right;
  pointer-events: none;
  user-select: none;
}

/* ============================================================ assembly: readers past the end of the signal (kept, flagged) */
.asm-reader.asm-past { border-color: var(--red); box-shadow: 0 0 0 2px #b5452f40, inset 0 1px 0 #fff9; }
.asm-reader.asm-past .strip-step b,
.asm-reader.asm-past .asm-vote-btn { color: #ff9b84; text-shadow: none; }
.asm-past-note {
  max-width: 120px;
  font: 10.5px/1.2 var(--f-type);
  color: var(--ink-red);
  text-align: center;
}
.strip-pop-pos .pop-tile.past:not(.on) { opacity: 0.45; border-style: dashed; }
.strip-pop-pos .pop-tile.past.on { background: radial-gradient(circle at 45% 35%, #ffd0c4, #e0614a 70%); border-color: #5c1f13; }

/* ============================================================ check dials (Σ) and the check-matrix seal (H) */
/* -- on the strip */
.strip-wts {
  display: inline-grid;
  grid-template-columns: repeat(var(--n, 4), auto);
  gap: 2px;
  padding: 2px 3px;
  border-radius: 3px;
  background: #00000026;
  box-shadow: inset 0 1px 2px #0005;
}
.strip-wt { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; }
.strip-board .strip-wts .tpl-cell,
.strip-ghost .strip-wts .tpl-cell { min-width: 16px; height: 16px; font-size: 10px; padding: 0 1px; border-radius: 2px; }
.strip-wt i { font: 12px/1 var(--f-mono); font-style: normal; color: #0f1b20; }
.strip-wt.off .tpl-cell { opacity: 0.35; filter: grayscale(0.8); }
.strip-wt.off i { opacity: 0.45; }
.strip-plate-tail { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.strip-mod { font: 10px/1 var(--f-ui); letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.85; white-space: nowrap; }
.strip-mod b { font: 13px/1 var(--f-mono); letter-spacing: 0; }
.strip-out {
  padding: 2px 5px;
  border-radius: 3px;
  background: var(--olive-900);
  color: var(--khaki);
  font: 11px/1 var(--f-mono);
  white-space: nowrap;
}
.strip-out b { color: var(--lamp); font-weight: normal; text-shadow: 0 0 5px #ffd25780; font-size: 13px; }
.strip-jam {
  padding: 2px 5px;
  border-radius: 3px;
  background: #1b0d08;
  color: #ff9b84;
  font: 11px/1 var(--f-stencil);
  letter-spacing: 0.06em;
  white-space: nowrap;
  animation: jam-blink 1.2s steps(2, jump-none) infinite;
}
@keyframes jam-blink { 50% { color: #ffd0c4; } }
@media (prefers-reduced-motion: reduce) { .strip-jam { animation: none; } }
.strip-seal.jammed { outline: 2px dashed #ffd0c4; outline-offset: -4px; }
.strip-mini {
  display: inline-grid;
  grid-template-columns: repeat(var(--cols, 4), 9px);
  gap: 1px;
  padding: 3px;
  border-radius: 3px;
  background: #00000040;
  box-shadow: inset 0 1px 2px #0007;
}
.strip-mini i { font: 10px/11px var(--f-mono); font-style: normal; text-align: center; color: var(--paper); }
.strip-mini i.s { color: var(--lamp); }
.strip-mini i.z { opacity: 0.35; }
.strip-mini em { grid-column: 1 / -1; font: 9px/1.1 var(--f-ui); font-style: normal; opacity: 0.8; }

/* digits in a variable's colour; seal digits */
.strip-pop .tpl-cell.strip-dig,
.strip-pop .tpl-cell.strip-sealcell { min-width: 22px; height: 22px; font: 14px/1 var(--f-mono); padding: 0 3px; }
.tpl-cell.strip-sealcell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  background: linear-gradient(180deg, #c9583f, var(--red) 60%, #7e2c1c);
  color: var(--paper);
  font-family: var(--f-mono);
  box-shadow: inset 0 0 0 1px #5c1f13;
}
.tpl-cell.strip-sealcell.strip-chkcell { background: linear-gradient(180deg, #a7bcc6, var(--steel) 70%, #485c66); box-shadow: inset 0 0 0 1px #33464f; color: #0f1b20; }
.ar-sname { margin: 0 1px 0 6px; font: 11px/1 var(--f-mono); letter-spacing: 0; color: var(--ink-red); }
.strip-pop thead .tpl-cell.strip-sealcell { min-width: 26px; height: 26px; font-size: 12px; }

/* -- the editor panel (popover; a bottom drawer on phones) */
.popover.strip-editor {
  max-width: min(600px, calc(100vw - 16px));
  max-height: calc(100vh - 16px);
  overflow: auto;
  overscroll-behavior: contain;
  box-sizing: border-box;
}
.popover.strip-editor.strip-drawer {
  left: 6px !important;
  right: 6px;
  top: auto !important;
  bottom: 6px;
  width: auto;
  max-width: none;
  max-height: 70vh;
  border-radius: 8px 8px 4px 4px;
  animation: drawer-in 0.18s ease-out;
}
@keyframes drawer-in { from { transform: translateY(24px); opacity: 0; } }
.strip-editor .pop-title { margin-bottom: 6px; }
.ed-intro { margin: 0 0 8px; max-width: 46ch; font: 13px/1.35 var(--f-type); color: #4a4535; }
.ed-label { font: 11px/1.2 var(--f-ui); letter-spacing: 0.12em; text-transform: uppercase; color: #5a5440; }
.ed-label small { letter-spacing: 0.02em; text-transform: none; font-size: 11px; color: #7d735a; margin-left: 4px; }
.ed-hint { font: 12px/1.3 var(--f-type); color: #7d735a; }
.ed-mod { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.ed-dials { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 8px; }
.ed-dial {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 5px 4px 4px;
  border-radius: 4px;
  background: #00000010;
  border: 1px solid #0000001f;
}
.ed-dial.off > .tpl-cell { opacity: 0.35; filter: grayscale(0.8); }
.strip-dial {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  width: 34px;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid #00000055;
  background: var(--olive-900);
  box-shadow: inset 0 1px 2px #0008;
}
.strip-dial-btn {
  height: 18px;
  padding: 0;
  border: 0;
  background: linear-gradient(180deg, var(--olive-600), var(--olive-700));
  color: var(--khaki);
  font: 9px/1 var(--f-ui);
  cursor: pointer;
}
.strip-dial-btn:hover { background: var(--olive-500); }
.strip-dial-val {
  height: 26px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--lamp);
  font: 17px/1 var(--f-mono);
  text-shadow: 0 0 5px #ffd25780;
  cursor: ns-resize;
}
.strip-dial.zero .strip-dial-val { color: #8a8466; text-shadow: none; }
.strip-dial-val:focus-visible,
.strip-dial-btn:focus-visible { outline: 2px solid var(--amber); outline-offset: -2px; }
.ed-stamps { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 2px 0 8px; }
.ed-stamp {
  padding: 4px 8px;
  border: 1px dashed #7a5512;
  border-radius: 3px;
  background: #ffd25733;
  color: #5c3f0a;
  font: 12px/1 var(--f-mono);
  cursor: pointer;
}
.ed-stamp:hover { background: #ffd25766; }
.ed-stamp small { font: 10px/1 var(--f-ui); margin-left: 4px; opacity: 0.8; }
.ed-arith {
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 4px;
  background: #00000012;
  box-shadow: inset 0 1px 3px #0003;
  font: 14px/1.5 var(--f-mono);
  color: var(--ink);
}
.ed-arith:empty { display: none; }
.ar-head { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; margin-bottom: 6px; font: 11px/1.2 var(--f-ui); letter-spacing: 0.1em; text-transform: uppercase; color: #5a5440; }
.ar-head > span:first-child { margin-right: 4px; }
.ar-arrow { margin: 0 4px 0 8px; }
.ar-line { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 4px; min-height: 26px; }
.ar-line + .ar-line { margin-top: 2px; }
.ar-line b { font-weight: normal; padding: 0 3px; border-radius: 2px; background: #ffd25766; }
.ar-line small { font: 12px/1.2 var(--f-type); color: #7d735a; }
.ar-line.dim { font: 13px/1.35 var(--f-type); color: #6d6550; }
.ar-term { display: inline-flex; align-items: center; gap: 1px; white-space: nowrap; }
.ar-op { color: #7d735a; padding: 0 1px; }
.ar-row { min-width: 46px; font: 11px/1 var(--f-ui); letter-spacing: 0.08em; text-transform: uppercase; color: #5a5440; }
.ar-ok { color: #3f6b1f; white-space: nowrap; }
.ar-send { font: 13px/1.3 var(--f-type); }
.ar-jam { font: 13px/1.4 var(--f-type); color: var(--ink-red); }
.ar-jam b { display: block; font: 14px/1.3 var(--f-stencil); letter-spacing: 0.05em; margin-bottom: 2px; }

/* matrix */
.ed-matrix-wrap { max-width: 100%; overflow-x: auto; margin: 4px 0 6px; padding-bottom: 2px; }
.ed-matrix { border-collapse: separate; border-spacing: 2px; }
.ed-matrix th { padding: 0; font-weight: normal; text-align: center; }
.ed-matrix th.first,
.ed-matrix td.first { padding-left: 6px; border-left: 2px solid #b5452f88; }
.ed-matrix td { padding: 0; text-align: center; }
.ed-matrix td.s { background: #b5452f14; }
.ed-matrix .ed-rowname { padding-right: 4px; font: 11px/1 var(--f-ui); letter-spacing: 0.08em; text-transform: uppercase; color: #5a5440; white-space: nowrap; text-align: right; }
.ed-cell {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid #00000059;
  border-radius: 3px;
  background: linear-gradient(180deg, #faf4e1, var(--paper-2));
  color: var(--ink);
  font: 15px/1 var(--f-mono);
  cursor: pointer;
}
.ed-cell.z { color: #a59c80; }
.ed-cell:hover { border-color: var(--ink); }
.ed-cell.act { background: radial-gradient(circle at 45% 35%, #fff6c8, var(--lamp) 60%, #d69a1e); border-color: #7a5512; box-shadow: 0 0 0 2px #e0a03088; color: #2a1d00; }
.ed-cell:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; }
.ed-matrix .ed-rowtools { padding-left: 6px; white-space: nowrap; text-align: left; }
.ed-rowtools .ed-stamps { display: inline-flex; flex-wrap: nowrap; margin: 0 4px 0 0; vertical-align: middle; }
.ed-rowtools .ed-stamp { padding: 3px 5px; font-size: 11px; }
.ed-rowdel {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid #0000004d;
  border-radius: 3px;
  background: transparent;
  color: var(--red);
  cursor: pointer;
  vertical-align: middle;
}
.ed-rowdel:hover:not(:disabled) { background: #b5452f22; }
.ed-rowdel:disabled { opacity: 0.3; cursor: default; }
.ed-pad { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 32px; margin: 2px 0 8px; }
.ed-keys { display: flex; flex-wrap: wrap; gap: 3px; }
.ed-key {
  min-width: 30px;
  height: 30px;
  padding: 0 4px;
  border: 1px solid #00000059;
  border-radius: 3px;
  background: var(--olive-800);
  color: var(--lamp);
  font: 15px/1 var(--f-mono);
  cursor: pointer;
}
.ed-key:hover { background: var(--olive-600); }
.ed-key.on { background: var(--lamp); color: #2a1d00; }
.ed-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.ed-btn {
  padding: 6px 10px;
  border: 1px solid #0006;
  border-radius: 3px;
  background: var(--olive-600);
  color: var(--khaki);
  font: 12px/1 var(--f-ui);
  letter-spacing: 0.06em;
  cursor: pointer;
}
.ed-btn:hover:not(:disabled) { background: var(--olive-500); color: var(--paper); }
.ed-btn:disabled { opacity: 0.45; cursor: default; }
.ed-btn small { font-size: 11px; opacity: 0.8; letter-spacing: 0; }
.ed-btn.ed-stamp { background: #ffd25733; color: #5c3f0a; border: 1px dashed #7a5512; font-family: var(--f-ui); }
@media (max-width: 560px) {
  .ed-cell,
  .ed-key { width: 34px; min-width: 34px; height: 34px; }
}

/* ============================================================ the shift register (CRC tile, ÷) */
.strip-crc {
  gap: 5px;
  padding: 4px 8px 4px 6px;
  color: var(--paper);
  border-color: #17332f;
  background:
    radial-gradient(circle at 4px 4px, #12302b 1.2px, transparent 1.7px),
    radial-gradient(circle at calc(100% - 4px) calc(100% - 4px), #12302b 1.2px, transparent 1.7px),
    linear-gradient(180deg, #6f9c92, #2f6f6a 58%, #1d4743);
}
.strip-crc .strip-plate-sym { font-size: 21px; text-shadow: 0 1px 0 #0007; }
.strip-crc-mid { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.strip-crc-taps {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 3px;
  background: #00000055;
  box-shadow: inset 0 1px 2px #0008;
}
.strip-crc-taps i { width: 8px; height: 8px; border-radius: 50%; background: #233029; box-shadow: inset 0 1px 1px #000c; }
.strip-crc-taps i.on { background: radial-gradient(circle at 40% 35%, #fff3c4, var(--lamp) 60%, #b8860b); box-shadow: 0 0 5px #ffd25799; }
.strip-crc-poly { font: 12px/1 var(--f-mono); white-space: nowrap; color: #fff3c4; }
.strip-crc .strip-mod { color: #e6f0e8; }

/* -- the editor: tap switches, the polynomial, its period, the long division */
.crc-taps { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.crc-tap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 42px;
  padding: 6px 6px 5px;
  border: 1px solid #00000033;
  border-radius: 4px;
  background: #00000010;
  color: var(--ink);
  font: 15px/1 var(--f-mono);
  cursor: pointer;
}
.crc-tap:hover:not(:disabled) { background: #ffd25733; }
.crc-tap:disabled { cursor: default; color: var(--ink); opacity: 0.8; }
.crc-lamp { width: 18px; height: 18px; border-radius: 50%; background: #3a3f30; box-shadow: inset 0 2px 3px #000a; }
.crc-tap.on .crc-lamp { background: radial-gradient(circle at 40% 35%, #fff3c4, var(--lamp) 60%, #b8860b); box-shadow: 0 0 8px #ffd257aa, inset 0 -1px 2px #0004; }
.crc-tap.on { border-color: #7a5512; }
.crc-info { margin: 0 0 6px; font: 13px/1.4 var(--f-type); color: #4a4535; }
.crc-poly { margin-bottom: 2px; font: 16px/1.4 var(--f-mono); color: var(--ink); }
.crc-poly b { font-weight: normal; padding: 0 4px; border-radius: 2px; background: #ffd25766; }
.crc-poly small { margin-left: 6px; font-size: 12px; color: #7d735a; letter-spacing: 0.1em; }
.crc-period b { font: 14px/1 var(--f-mono); }
.crc-period.warn { color: var(--ink-red); }
.crc-div { display: flex; flex-direction: column; max-width: 100%; overflow-x: auto; margin: 2px 0 6px; font: 13px/1.3 var(--f-mono); }
.crc-row { display: flex; align-items: center; gap: 8px; }
.crc-lab { flex: 0 0 52px; font: 11px/1 var(--f-ui); color: #5a5440; text-align: right; white-space: nowrap; }
.crc-bits { display: inline-flex; }
.crc-bits i { width: 1.15em; font-style: normal; text-align: center; white-space: pre; }
.crc-top .crc-bits i { font-weight: bold; }
.crc-bits i.z { color: #9a9070; font-weight: normal; }
.crc-bits i.g { color: #1d5c56; border-bottom: 1px solid #1d5c5699; }
.crc-bits i.rem { border-radius: 2px; background: #ffd25780; }

/* -- on the tape: the register being clocked (stage working line) */
.tape .stage-calc .tape-reg {
  display: inline-flex;
  gap: 3px;
  padding: 3px 4px;
  border-radius: 3px;
  background: #00000066;
  box-shadow: inset 0 1px 2px #000a;
  vertical-align: middle;
}
.tape .stage-calc .tape-reg i { width: 13px; height: 13px; border-radius: 50%; background: #2a2f22; box-shadow: inset 0 1px 2px #000c; }
.tape .stage-calc .tape-reg i.on { background: radial-gradient(circle at 40% 35%, #fff3c4, var(--lamp) 60%, #b8860b); box-shadow: 0 0 6px #ffd257aa; }
.tape .stage-calc .tape-in { display: inline-block; min-width: 1ch; color: #fff3c4; }
@media (max-width: 560px) {
  .crc-tap { min-width: 38px; }
  .crc-lab { flex-basis: 40px; }
}

/* places past what HQ sends: only there when the line slips extra symbols in (still pickable) */
.strip-pop-pos .pop-tile.spare { border-style: dashed; }
.strip-pop-pos .pop-tile.spare:not(.on) { opacity: .7; }
