/* CNC machine strip: scoped to the cutting board header. */
:is(#cncBoardRoot,#p3dBoardRoot) .cnc-head {
  position: relative;
  /* The search results must paint above pinned columns (z-index: 30). */
  z-index: 40;
  overflow: visible;
}
:is(#cncBoardRoot,#p3dBoardRoot) .cnc-find {
  flex: 0 1 400px;
  width: 400px;
  min-width: min(320px, 100%);
  max-width: 400px;
  transition: flex-basis .28s ease, width .28s ease, max-width .28s ease;
}
:is(#cncBoardRoot,#p3dBoardRoot) .cnc-find.has-query {
  flex-basis: 760px;
  width: 760px;
  max-width: 760px;
}
:is(#cncBoardRoot,#p3dBoardRoot) .cnc-find-inp {
  border: 1.5px solid #9db7d2;
  box-shadow: 0 1px 3px rgba(21, 88, 168, .08);
}
:is(#cncBoardRoot,#p3dBoardRoot) .cnc-find-inp:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(21, 88, 168, .12);
}
:is(#cncBoardRoot,#p3dBoardRoot) .cnc-find-list {
  max-height: min(66vh, 680px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
:is(#cncBoardRoot,#p3dBoardRoot) .cnc-find-list.open {
  animation: cnc-find-enter .18s ease-out both;
}
@keyframes cnc-find-enter {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}
:is(#cncBoardRoot,#p3dBoardRoot) .cnc-find-results-head {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 9px 13px;
  border-bottom: 1px solid #e5edf5;
  background: #f5f9fd;
  color: #53708d;
  font-size: 11px;
  font-weight: 800;
}
:is(#cncBoardRoot,#p3dBoardRoot) .cnc-find-more {
  padding: 10px 13px;
  color: #53708d;
  background: #f5f9fd;
  font-size: 11px;
  line-height: 1.4;
  font-weight: 700;
}
:is(#cncBoardRoot,#p3dBoardRoot) .cnc-find-op {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: 0;
  border-bottom: 1px solid #e9eff5;
  border-radius: 0;
  background: transparent;
  text-align: left;
  font-family: var(--font);
  color: var(--text);
  padding: 10px 13px;
}
:is(#cncBoardRoot,#p3dBoardRoot) .cnc-find-op:last-child { border-bottom: 0; }
:is(#cncBoardRoot,#p3dBoardRoot) .cnc-find-op:hover,
:is(#cncBoardRoot,#p3dBoardRoot) .cnc-find-op:focus-visible {
  outline: none;
  background: #edf5ff;
}
:is(#cncBoardRoot,#p3dBoardRoot) .cnc-find-op:focus-visible { box-shadow: inset 3px 0 var(--blue); }
:is(#cncBoardRoot,#p3dBoardRoot) .cnc-find-result-top {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  line-height: 1.4;
}
:is(#cncBoardRoot,#p3dBoardRoot) .cnc-find-result-loc {
  flex: 0 0 auto;
  max-width: 35%;
  box-sizing: border-box;
  padding: 2px 6px;
  border-radius: 5px;
  background: #eaf1f9;
  color: #40617f;
  font-size: 10px;
  font-weight: 800;
  white-space: normal;
  overflow-wrap: anywhere;
}
:is(#cncBoardRoot,#p3dBoardRoot) .cnc-find-result-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  font-weight: 800;
  white-space: normal;
  overflow-wrap: anywhere;
}
:is(#cncBoardRoot,#p3dBoardRoot) .cnc-find-result-props {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 6px;
  color: #53677c;
  font-size: 11px;
  line-height: 1.4;
}
:is(#cncBoardRoot,#p3dBoardRoot) .cnc-find-result-props > span {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
:is(#cncBoardRoot,#p3dBoardRoot) .cnc-find-result-props b { color: #243c57; font-weight: 700; }
:is(#cncBoardRoot,#p3dBoardRoot) .cnc-find-result-title b,
:is(#cncBoardRoot,#p3dBoardRoot) .cnc-find-result-props > span b:not(:first-of-type) {
  background: #fef3c7;
  border-radius: 3px;
}
@media (max-width: 640px) {
  :is(#cncBoardRoot,#p3dBoardRoot) .cnc-find,
  :is(#cncBoardRoot,#p3dBoardRoot) .cnc-find.has-query {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
}
.dept-page-header.cnc-page-header {
  flex-wrap: wrap;
  align-items: flex-start;
  min-width: 0;
  row-gap: 10px;
}
.cnc-page-header .cnc-page-heading {
  display: grid;
  grid-template-columns: max-content max-content;
  grid-template-rows: auto auto;
  align-items: start;
  column-gap: 12px;
  row-gap: 8px;
  flex: 0 0 auto;
  min-width: 0;
  justify-content: start;
  padding-top: 4px;
}
.cnc-page-header .cnc-page-heading > span {
  grid-column: 1;
  grid-row: 1;
}
.cnc-page-header .cnc-page-heading > .dept-page-title {
  grid-column: 2;
  grid-row: 1;
}
.cnc-page-header .cnc-page-heading > .dept-back-btn {
  grid-column: 1 / -1;
  grid-row: 2;
  justify-self: start;
}

.cnc-page-header .cnc-machines {
  display: flex;
  flex: 1 1 650px;
  align-items: stretch;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  box-sizing: border-box;
  padding: 4px 2px 9px;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 2px;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: #9fb3cc transparent;
}

.cnc-page-header .cnc-machines::-webkit-scrollbar { height: 6px; }
.cnc-page-header .cnc-machines::-webkit-scrollbar-track { background: transparent; }
.cnc-page-header .cnc-machines::-webkit-scrollbar-thumb {
  background: #a9bad0;
  border-radius: 999px;
}

.cnc-page-header .cnc-machine {
  --cnc-trim: #53768f;
  position: relative;
  flex: 1 0 205px;
  width: 205px;
  max-width: 300px;
  height: 291px;
  min-width: 0;
  box-sizing: border-box;
  padding: 5px 6px 6px;
  border: 1px solid #c7d4e2;
  border-radius: 12px;
  background: linear-gradient(145deg, #f8fafc, #e6edf5);
  box-shadow: 0 2px 5px rgba(22, 42, 67, .08), inset 0 1px rgba(255, 255, 255, .9);
  scroll-snap-align: start;
  transition: border-color .22s ease, background .3s ease, box-shadow .3s ease, transform .22s ease;
}

.cnc-page-header .cnc-machine:nth-child(2) { --cnc-trim: #a65a53; }
.cnc-page-header .cnc-machine:nth-child(3) { --cnc-trim: #4a8497; }
.cnc-page-header .cnc-machine:nth-child(4) { --cnc-trim: #796988; }
.cnc-page-header .cnc-machine:nth-child(5) { --cnc-trim: #597896; }
.cnc-page-header .cnc-machine:nth-child(6) { --cnc-trim: #597f76; }

.cnc-page-header .cnc-machine-bed {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 236px;
  box-sizing: border-box;
  overflow: hidden;
  border: 5px solid #667585;
  border-top-color: #a3adba;
  border-left-color: #929daa;
  border-right-color: #4e5d6e;
  border-bottom-color: #445467;
  border-radius: 8px;
  background: #172b38;
  box-shadow: inset 0 0 0 1px #10212c, inset 0 9px 16px rgba(0, 0, 0, .23), 0 1px 2px rgba(14, 33, 48, .18);
  transition: border-color .3s ease, box-shadow .3s ease, filter .4s ease;
}

/* The dimmer is above the bed but cannot intercept clicks or drops. */
.cnc-page-header .cnc-machine-bed::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 8;
  background: #07121c;
  opacity: 0;
  pointer-events: none;
  transition: opacity .5s ease;
}

.cnc-page-header .cnc-machine-surface {
  position: absolute;
  inset: 6px 9px;
  z-index: 1;
  overflow: hidden;
  border: 1px solid rgba(138, 177, 184, .32);
  border-radius: 3px;
  background:
    linear-gradient(90deg, transparent calc(50% - .5px), rgba(173, 204, 199, .12) 50%, transparent calc(50% + .5px)),
    repeating-linear-gradient(0deg, rgba(119, 169, 164, .09) 0 1px, transparent 1px 13px),
    repeating-linear-gradient(90deg, rgba(119, 169, 164, .09) 0 1px, transparent 1px 13px),
    linear-gradient(145deg, #213943, #122832);
  box-shadow: inset 0 0 14px rgba(0, 0, 0, .22);
  pointer-events: none;
}

.cnc-page-header .cnc-machine-surface::before,
.cnc-page-header .cnc-machine-surface::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(90deg, #536d76, #a8bcc2, #4b616a);
  box-shadow: 0 0 3px rgba(185, 220, 221, .25);
}
.cnc-page-header .cnc-machine-surface::before { left: 2px; }
.cnc-page-header .cnc-machine-surface::after { right: 2px; }

.cnc-page-header .cnc-machine-job {
  position: absolute;
  z-index: 3;
  top: 16px;
  bottom: 10px;
  left: 12px;
  right: 12px;
  width: auto;
  height: auto;
  min-width: 0;
  max-width: none;
  box-sizing: border-box;
  display: block;
  padding: 8px 9px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #9acaae transparent;
  overscroll-behavior: contain;
  border: 1px solid #b8d8c8;
  border-radius: 5px;
  background: linear-gradient(145deg, #f3fff6, #d6efe0);
  color: #174a36;
  font: 600 11.5px/1.3 var(--font, system-ui, sans-serif);
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .27);
  cursor: pointer;
  user-select: none;
  transition: box-shadow .2s ease, background .2s ease;
}
.cnc-page-header .cnc-machine-job:hover {
  background: #f8fffa;
  box-shadow: 0 3px 10px rgba(11, 106, 60, .35);
}
.cnc-page-header .cnc-machine-job.is-filtered { opacity: .48; }
.cnc-page-header .cnc-machine-job:focus-visible {
  outline: 2px solid #55d49a;
  outline-offset: 2px;
}
.cnc-page-header .cnc-machine-job[draggable="true"] { cursor: grab; }
.cnc-page-header .cnc-machine-job[draggable="true"]:active { cursor: grabbing; }
.cnc-page-header .cnc-machine-job::-webkit-scrollbar { width: 5px; }
.cnc-page-header .cnc-machine-job::-webkit-scrollbar-thumb { background: #9acaae; border-radius: 99px; }
.cnc-page-header .cnc-machine-job-title {
  display: block;
  color: #12432f;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 800;
}
.cnc-page-header .cnc-machine-job-project {
  display: block;
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px solid rgba(43, 122, 82, .2);
  color: #205a42;
}
.cnc-page-header .cnc-machine-job-project b { color: #3e775a; font-weight: 700; }
.cnc-page-header .cnc-machine-job-meta {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 6px;
  margin-top: 5px;
}
.cnc-page-header .cnc-machine-job-meta > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.cnc-page-header .cnc-machine-job-meta > span:nth-child(odd) { color: #557665; }
.cnc-page-header .cnc-machine-job-meta > span:nth-child(even) { font-weight: 700; }
.cnc-page-header .cnc-machine-job-urgent {
  display: block;
  width: max-content;
  max-width: 100%;
  margin-top: 6px;
  padding: 2px 5px;
  border-radius: 4px;
  background: #fff1d8;
  color: #9b4c11;
  font-weight: 800;
}

.cnc-page-header .cnc-machine-empty {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px;
  color: #adc4c9;
  font: 600 10px/1.2 var(--font, system-ui, sans-serif);
  text-align: center;
  pointer-events: none;
}
.cnc-page-header .cnc-machine.is-running .cnc-machine-empty { display: none; }

/* Gantry and cutter sit above the job, while their pointer events pass through it. */
.cnc-page-header .cnc-machine-gantry {
  position: absolute;
  z-index: 4;
  top: 17px;
  left: 7px;
  right: 7px;
  height: 9px;
  border: 1px solid #b9c8d0;
  border-bottom-color: #5c7583;
  border-radius: 3px;
  background: linear-gradient(#e2eaf0 0 22%, #8197a4 23% 65%, #4c6472 66%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .45);
  pointer-events: none;
  will-change: transform;
}
.cnc-page-header .cnc-machine-gantry::before,
.cnc-page-header .cnc-machine-gantry::after {
  content: '';
  position: absolute;
  top: -3px;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(90deg, #344b58, #8fa6b0, #344b58);
}
.cnc-page-header .cnc-machine-gantry::before { left: -5px; }
.cnc-page-header .cnc-machine-gantry::after { right: -5px; }

.cnc-page-header .cnc-machine-spindle {
  position: absolute;
  top: -6px;
  left: 15%;
  width: 14px;
  height: 19px;
  box-sizing: border-box;
  border: 1px solid #91a9b2;
  border-radius: 3px 3px 5px 5px;
  background: linear-gradient(90deg, #415d6b, #d5e3e7 45%, #6a8390);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .4);
  pointer-events: none;
}
.cnc-page-header .cnc-machine-spindle::after {
  content: '';
  position: absolute;
  left: 5px;
  bottom: -6px;
  width: 2px;
  height: 7px;
  border-radius: 1px;
  background: #d7ebe8;
  box-shadow: 0 0 4px #e7f7ee;
}

.cnc-page-header .cnc-machine-name {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  min-width: 0;
  height: 24px;
  overflow: hidden;
  color: #263c4b;
  font: 800 10.5px/1.15 var(--font, system-ui, sans-serif);
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: .01em;
}
.cnc-page-header .cnc-machine-name::before {
  content: '';
  flex: 0 0 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cnc-trim);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .75);
}

.cnc-page-header .cnc-machine-size {
  width: 100%;
  overflow: hidden;
  color: #63778b;
  font: 700 10px/14px var(--font, system-ui, sans-serif);
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cnc-page-header .cnc-machine-web {
  display: none;
  position: absolute;
  z-index: 9;
  top: 5px;
  right: 5px;
  width: 51px;
  height: 51px;
  opacity: .75;
  clip-path: polygon(0 0, 100% 0, 100% 100%);
  background:
    repeating-radial-gradient(circle at 100% 0%, transparent 0 8px, rgba(226, 240, 239, .74) 8.5px 9.5px),
    repeating-conic-gradient(from 180deg at 100% 0%, rgba(226, 240, 239, .72) 0deg 2deg, transparent 2deg 21deg);
  pointer-events: none;
}
.cnc-page-header .cnc-machine.is-cobweb .cnc-machine-web,
.cnc-page-header .cnc-machine.is-off .cnc-machine-web { display: block; }
.cnc-page-header .cnc-machine.is-running .cnc-machine-web { display: none; }

/* After a long stop the webs spread to all four corners of the empty bed. */
.cnc-page-header .cnc-machine.is-long-idle .cnc-machine-web {
  display: block;
  inset: 2px;
  width: auto;
  height: auto;
  opacity: .9;
  clip-path: none;
  background: url('cnc-idle-web.svg') center / 100% 100% no-repeat;
  transition: opacity .2s ease;
}
.cnc-page-header .cnc-machine.is-running.is-long-idle .cnc-machine-web { display: none; }
.cnc-page-header .cnc-machine.is-drop-hover .cnc-machine-web { opacity: 0; }

.cnc-page-header .cnc-machine-idle-timer {
  position: absolute;
  z-index: 10;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  max-width: calc(100% - 24px);
  box-sizing: border-box;
  padding: 4px 8px;
  border: 1px solid rgba(214, 227, 231, .36);
  border-radius: 6px;
  background: rgba(18, 33, 41, .87);
  box-shadow: 0 2px 7px rgba(0, 0, 0, .28);
  color: #e8f3f0;
  font: 700 11.5px/1.2 var(--font, system-ui, sans-serif);
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
  white-space: nowrap;
  pointer-events: none;
}
.cnc-page-header .cnc-machine-idle-timer[hidden] { display: none; }
body.va-on .cnc-page-header .cnc-machine-idle-timer { display: none; }

.cnc-page-header .cnc-machine.is-running {
  border-color: #5dbf8a;
  background: linear-gradient(145deg, #f1fff5, #dcefe4);
  box-shadow: 0 0 0 2px rgba(64, 196, 117, .18), 0 5px 16px rgba(26, 147, 77, .2);
}
.cnc-page-header .cnc-machine.is-running .cnc-machine-bed {
  border-color: #65a884;
  border-top-color: #aedac2;
  border-bottom-color: #337453;
  box-shadow: inset 0 0 0 1px #194c3d, inset 0 0 20px rgba(35, 226, 127, .2), 0 0 11px rgba(34, 197, 94, .3);
}
.cnc-page-header .cnc-machine.is-running .cnc-machine-name { color: #17613d; }
.cnc-page-header .cnc-machine.is-running .cnc-machine-name::before {
  background: #27c878;
  box-shadow: 0 0 0 2px #e7fff0, 0 0 7px #34d88b;
}
.cnc-page-header .cnc-machine.is-running .cnc-machine-job {
  border-color: #7fdbab;
  box-shadow: 0 0 0 1px rgba(84, 222, 153, .28), 0 3px 8px rgba(0, 0, 0, .28);
}
.cnc-page-header .cnc-machine.is-running .cnc-machine-gantry {
  animation: cncMachineGantryTravel 3.1s ease-in-out infinite alternate;
}
.cnc-page-header .cnc-machine.is-running .cnc-machine-spindle {
  animation: cncMachineSpindleSweep 2.4s ease-in-out infinite alternate;
}
.cnc-page-header .cnc-machine.is-running .cnc-machine-spindle::after {
  background: #99ffc5;
  box-shadow: 0 0 5px 2px rgba(81, 255, 145, .8);
}
.cnc-page-header .cnc-machine.is-running .cnc-machine-bed::after { opacity: 0; }

@keyframes cncMachineGantryTravel {
  from { transform: translateY(0); }
  to { transform: translateY(181px); }
}
@keyframes cncMachineGantryTravelMobile {
  from { transform: translateY(0); }
  to { transform: translateY(220px); }
}
@keyframes cncMachineSpindleSweep {
  from { left: 15%; }
  to { left: 78%; }
}

.cnc-page-header .cnc-machine.is-off {
  border-color: #aeb9c4;
  background: linear-gradient(145deg, #e9edf2, #d6dfe8);
  box-shadow: inset 0 1px 4px rgba(29, 43, 57, .1);
}
.cnc-page-header .cnc-machine.is-off .cnc-machine-bed { filter: saturate(.4); }
.cnc-page-header .cnc-machine.is-off .cnc-machine-bed::after { opacity: .54; }
.cnc-page-header .cnc-machine.is-off .cnc-machine-name { color: #66717d; }
.cnc-page-header .cnc-machine.is-off .cnc-machine-name::before {
  background: #8995a0;
  box-shadow: 0 0 0 2px #e4eaf0;
}

.cnc-page-header .cnc-machine.is-drop-hover {
  border-color: #28bd73;
  background: #e7fff0;
  box-shadow: 0 0 0 3px rgba(26, 195, 105, .3), 0 5px 15px rgba(20, 121, 69, .16);
  transform: translateY(-2px);
}
.cnc-page-header .cnc-machine.is-drop-hover .cnc-machine-bed {
  border-color: #57d98b;
  box-shadow: inset 0 0 0 1px #21563d, inset 0 0 20px rgba(52, 211, 122, .24);
  filter: none;
}
.cnc-page-header .cnc-machine.is-drop-hover .cnc-machine-bed::after { opacity: 0; }

@media (max-width: 760px) {
  .cnc-page-header .cnc-page-heading { flex-basis: 100%; }
  .cnc-page-header .cnc-machines { flex: 1 1 100%; }
  .cnc-page-header .cnc-machine { flex-basis: 245px; width: 245px; height: 331px; }
  .cnc-page-header .cnc-machine-bed { height: 276px; }
  .cnc-page-header .cnc-machine.is-running .cnc-machine-gantry { animation-name: cncMachineGantryTravelMobile; }
}

@media (prefers-reduced-motion: reduce) {
  .cnc-page-header .cnc-machines { scroll-behavior: auto; }
  .cnc-page-header .cnc-machine,
  .cnc-page-header .cnc-machine-bed,
  .cnc-page-header .cnc-machine-bed::after,
  .cnc-page-header .cnc-machine-job { transition: none; }
  .cnc-page-header .cnc-machine.is-running .cnc-machine-gantry {
    animation: none;
    transform: translateY(90px);
  }
  .cnc-page-header .cnc-machine.is-running .cnc-machine-spindle {
    animation: none;
    left: 48%;
  }
  .cnc-page-header .cnc-machine.is-drop-hover { transform: none; }
}

.cnc-page-header .cnc-machine-name > span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Ремонт станка: две перекрёстные сигнальные ленты поверх рабочего поля. */
.cnc-page-header .cnc-machine-gear {
  position: absolute;
  z-index: 12;
  top: 9px;
  left: 10px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #9aabc0;
  border-radius: 7px;
  background: #f8fbff;
  color: #243b53;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
  font: 22px/1 system-ui, sans-serif;
  cursor: pointer;
}
.cnc-page-header .cnc-machine-gear:hover { background: #fff3cf; border-color: #c58b1c; }
.cnc-page-header .cnc-machine-gear:focus-visible { outline: 2px solid #efae22; outline-offset: 2px; }
.cnc-page-header .cnc-machine.has-repair-control .cnc-machine-job-title { padding-left: 28px; min-height: 25px; }
.cnc-page-header .cnc-machine.is-repair {
  border-color: #d69d25;
  background: linear-gradient(145deg, #fff8df, #eee1bb);
  box-shadow: 0 0 0 2px rgba(241,185,42,.2), 0 4px 12px rgba(101,76,17,.16);
}
.cnc-page-header .cnc-machine.is-repair .cnc-machine-bed {
  border-color: #b99b57;
  background: #18232b;
  filter: none;
}
.cnc-page-header .cnc-machine.is-repair .cnc-machine-bed::after { opacity: .43; }
.cnc-page-header .cnc-machine.is-repair .cnc-machine-name { color: #75510b; }
.cnc-page-header .cnc-machine.is-repair .cnc-machine-name::before { background: #efb42d; box-shadow: 0 0 0 2px #fff0c1; }
.cnc-page-header .cnc-machine.is-repair .cnc-machine-gantry,
.cnc-page-header .cnc-machine.is-repair .cnc-machine-spindle { animation: none !important; }
.cnc-page-header .cnc-machine-repair-art {
  position: absolute;
  z-index: 9;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.cnc-page-header .cnc-machine-repair-art i {
  position: absolute;
  display: block;
  left: -23%;
  top: 28%;
  width: 146%;
  height: 30px;
  border-top: 2px solid #f9da74;
  border-bottom: 2px solid #181818;
  background: repeating-linear-gradient(115deg, #f7c933 0 18px, #17191b 18px 35px);
  box-shadow: 0 4px 10px rgba(0,0,0,.54);
  transform: rotate(29deg);
}
.cnc-page-header .cnc-machine-repair-art i + i { top: 58%; transform: rotate(-29deg); }
.cnc-page-header .cnc-machine-repair-label,
.cnc-page-header .cnc-machine-repair-timer {
  position: absolute;
  z-index: 10;
  left: 50%;
  max-width: calc(100% - 18px);
  padding: 5px 9px;
  border: 1px solid #f6cc54;
  border-radius: 6px;
  background: #1b2024;
  color: #ffd85b;
  box-shadow: 0 2px 8px rgba(0,0,0,.45);
  font: 800 11px/1.2 var(--font, system-ui, sans-serif);
  letter-spacing: .05em;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
  transform: translateX(-50%);
}
.cnc-page-header .cnc-machine-repair-label { top: 43%; }
.cnc-page-header .cnc-machine-repair-timer { bottom: 10px; font-variant-numeric: tabular-nums; font-size: 10px; }
.cnc-machine-repair-overlay { z-index: 1006; align-items: center; padding: 12px; }
.cnc-machine-repair-card { width: min(420px, 100%); max-width: calc(100vw - 24px); }
.cnc-machine-repair-body { padding: 18px 20px 22px; color: var(--text); font: 500 13px/1.5 var(--font, system-ui, sans-serif); }
.cnc-machine-repair-body p { margin: 0 0 15px; }
.cnc-machine-repair-note { padding: 10px 12px; border-radius: 8px; background: #fff2ca; color: #684709; }
.cnc-machine-repair-action { width: 100%; padding: 11px 15px; border: 1px solid #b78b23; border-radius: 8px; background: #ffd464; color: #292112; font: 800 13px var(--font, system-ui, sans-serif); cursor: pointer; }
.cnc-machine-repair-action:hover { background: #ffe394; }
.cnc-machine-repair-action:focus-visible { outline: 2px solid #284e83; outline-offset: 2px; }

.cnc-machine-repair-action:disabled { opacity: .7; cursor: wait; }

/* The project view shares cards and machine drag handlers with the native columns. */
#cncBoardRoot .cnc-view-switch { display:flex; gap:4px; flex-wrap:wrap; }
#cncBoardRoot .cnc-view-switch .cnc-btn { min-height:36px; }
#cncBoardRoot .cnc-view-switch .cnc-btn:focus-visible { outline:2px solid var(--blue); outline-offset:2px; }
#cncBoardRoot .cnc-card-source { margin:5px 0; font-size:11px; color:var(--muted); overflow-wrap:anywhere; }
