.line-board {
  --lb-teal: var(--cs-accent);
  --lb-ink: var(--ink);
  --lb-border: var(--border);
  color: var(--lb-ink);
  padding: 0;
  max-width: 1600px;
  margin: auto;
  font-family: inherit;
  background: transparent;
  min-height: 0;
}
.line-board * {
  box-sizing: border-box;
}
.line-board h1 {
  font-size: 20px;
  margin: 5px 0;
}
.line-board h2 {
  font-size: 16px;
  margin: 0;
}
.line-board h3 {
  font-size: 16px;
  margin: 0;
}
.line-board p {
  font-size: 13px;
  line-height: 1.8;
  margin: 7px 0;
  color: var(--ink-2);
}
.line-board small {
  font-size: 11px;
  color: var(--ink-2);
}
.lb-top,
.lb-toolbar,
.lb-section-title,
.lb-bath header,
.lb-dialog header,
.lb-dialog footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.lb-top {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--lb-border);
  flex-wrap: wrap;
}
.lb-eyebrow {
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--lb-teal);
  font-weight: 700;
}
.lb-toolbar {
  flex-wrap: wrap;
}
.line-board button,
.line-board select,
.line-board input {
  font: inherit;
  font-size: 13px;
  border: 1px solid var(--lb-border);
  border-radius: 9px;
  padding: 10px 13px;
  background: var(--cs-surface);
  color: var(--lb-ink);
  max-width: 100%;
  min-height: 42px;
}
.line-board button {
  cursor: pointer;
}
.line-board button:hover {
  border-color: var(--lb-teal);
  background: var(--surface-2);
}
.line-board button:disabled {
  opacity: 0.6;
  cursor: wait;
}
.line-board button:focus-visible,
.line-board input:focus,
.line-board select:focus {
  outline: 2px solid var(--lb-teal);
  outline-offset: 2px;
}
.line-board .lb-primary {
  background: var(--lb-teal);
  color: var(--accent-foreground);
  border-color: var(--lb-teal);
}
.line-board a {
  color: var(--cs-accent);
  font-size: 13px;
  text-decoration: none;
}
.lb-line-state {
  background: var(--surface-2);
  color: var(--lb-ink);
  border: 1px solid var(--lb-border);
  border-radius: 15px;
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 1fr 1fr;
  gap: 20px;
  padding: 22px;
  margin-bottom: 24px;
}
.lb-line-state > div {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.lb-line-state > div:first-child {
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
}
.lb-line-state span,
.lb-line-state small {
  font-size: 11px;
  color: var(--ink-2);
}
.lb-line-state strong {
  font-size: 14px;
}
.lb-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ink-3);
}
.lb-dot.on {
  background: var(--cs-success);
  box-shadow: 0 0 0 5px transparent;
}
.lb-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 24px;
}
.lb-section-title {
  margin-bottom: 17px;
  flex-wrap: wrap;
}
.lb-bath-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 16px;
}
.lb-bath,
.lb-powder,
.lb-panel {
  background: var(--cs-surface);
  border: 1px solid var(--lb-border);
  border-radius: 14px;
  padding: 20px;
  min-width: 0;
}
.lb-bath.retired {
  opacity: 0.7;
}
.lb-pill {
  background: var(--surface-2);
  border-radius: 20px;
  color: var(--cs-accent);
  font-size: 11px;
  padding: 5px 10px;
  white-space: nowrap;
}
.lb-solution {
  min-height: 22px;
}
.lb-tank {
  height: 150px;
  border: 5px solid var(--border);
  border-top: 0;
  border-radius: 5px 5px 22px 22px;
  margin: 24px 8px 15px;
  position: relative;
  overflow: hidden;
  background: repeating-linear-gradient(
    0deg,
    var(--cs-surface),
    var(--cs-surface) 24px,
    var(--surface-2) 25px
  );
}
.lb-wave {
  position: absolute;
  bottom: 0;
  height: 38%;
  width: 100%;
  background: repeating-linear-gradient(
    135deg,
    var(--surface-2),
    var(--surface-2) 7px,
    var(--cs-surface) 7px,
    var(--cs-surface) 14px
  );
  border-top: 2px dashed var(--border);
}
.lb-tank > div:last-child {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.lb-tank strong {
  font-size: 15px;
}
.line-board dl {
  font-size: 12px;
  margin: 16px 0;
}
.line-board dl > div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.line-board dt {
  color: var(--ink-2);
}
.line-board dd {
  margin: 0;
  text-align: left;
}
.lb-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.lb-actions button {
  font-size: 11px;
  padding: 8px;
}
.lb-actions .lb-muted {
  grid-column: 1/-1;
  border: 0;
  color: var(--ink-2);
  background: transparent;
}
.line-board details {
  font-size: 12px;
  margin-top: 10px;
  overflow-wrap: anywhere;
}
.line-board summary {
  cursor: pointer;
  padding: 8px 0;
  color: var(--ink-2);
}
.lb-powder {
  align-self: start;
}
.lb-powder-visual {
  display: flex;
  gap: 25px;
  align-items: center;
  margin: 30px 0;
}
.lb-powder-column {
  height: 155px;
  width: 68px;
  flex-shrink: 0;
  background: repeating-linear-gradient(
    0deg,
    var(--surface-2),
    var(--surface-2) 17px,
    var(--cs-surface) 18px
  );
  border-radius: 8px 8px 16px 16px;
  border: 4px solid var(--border);
  display: flex;
  align-items: end;
  justify-content: center;
  padding-bottom: 10px;
  color: var(--ink-2);
}
.lb-big {
  display: block;
  font-size: 35px;
  font-variant-numeric: tabular-nums;
  margin: 8px 0;
  overflow-wrap: anywhere;
}
.lb-measured {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
}
.lb-note {
  font-size: 11px !important;
  color: var(--ink-2) !important;
}
.lb-powder > .lb-primary {
  width: 100%;
  margin: 15px 0;
}
.lb-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 24px 0;
}
.lb-person {
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--border);
  padding: 14px 0;
  font-size: 13px;
}
.lb-person > div:nth-child(2) {
  flex: 1;
}
.lb-person p {
  font-size: 11px;
}
.lb-person button {
  font-size: 11px;
}
.lb-avatar {
  height: 40px;
  width: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--cs-accent-soft);
  color: var(--info-text);
  flex-shrink: 0;
}
.lb-dies {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 15px 0;
}
.lb-dies article {
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 12px;
  flex: 1;
  min-width: 125px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
}
.lb-die-icon {
  font-size: 35px;
  line-height: 1;
  color: var(--ink-3);
}
.lb-history article {
  display: flex;
  gap: 15px;
  padding: 13px 0;
  border-top: 1px solid var(--border);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.lb-event-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cs-accent);
  margin-top: 7px;
  flex-shrink: 0;
}
.lb-history small {
  font-size: 10px;
}
.lb-alert {
  padding: 14px;
  background: var(--warn-soft);
  color: var(--warn-text);
  border: 1px solid var(--warn-border);
  border-radius: 10px;
  font-size: 13px;
  margin: 10px 0;
  overflow-wrap: anywhere;
}
.lb-empty {
  padding: 35px;
  text-align: center;
  background: var(--cs-surface);
  border: 1px dashed var(--border);
  border-radius: 14px;
}
.lb-overlay {
  position: fixed;
  inset: 0;
  background: var(--backdrop);
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 16px;
}
.lb-dialog {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow: auto;
  background: var(--cs-surface);
  border-radius: 16px;
  padding: 0;
  box-shadow: 0 20px 70px color-mix(in srgb, var(--ink) 20%, transparent);
}
.lb-dialog label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
  margin: 14px 0;
}
.lb-dialog footer {
  justify-content: end;
  margin-top: 20px;
}
.lb-dialog input,
.lb-dialog select {
  width: 100%;
}
.lb-dialog input:invalid {
  box-shadow: none;
}
@media (max-width: 1000px) {
  .lb-layout {
    grid-template-columns: 1fr;
  }
  .lb-powder {
    display: block;
  }
  .lb-line-state {
    grid-template-columns: 1fr 1fr;
  }
  .lb-powder-visual {
    margin: 16px 0;
  }
  .lb-powder-column {
    height: 100px;
  }
}
@media (max-width: 600px) {
  .line-board {
    padding: 0;
  }
  .lb-toolbar {
    width: 100%;
    gap: 6px;
  }
  .lb-toolbar select {
    width: 100%;
  }
  .lb-top h1 {
    font-size: 20px;
  }
  .lb-line-state {
    gap: 18px;
    padding: 18px;
  }
  .lb-line-state > div:first-child {
    grid-column: 1/-1;
  }
  .lb-bath-grid,
  .lb-bottom {
    grid-template-columns: 1fr;
  }
  .lb-panel,
  .lb-bath,
  .lb-powder {
    padding: 16px;
  }
  .lb-person {
    flex-wrap: wrap;
  }
  .lb-dialog {
    padding: 18px;
  }
  .lb-dialog header h2 {
    font-size: 17px;
  }
}
@media print {
  .line-board {
    background: var(--cs-surface);
    padding: 0;
  }
  .lb-toolbar,
  .lb-actions,
  .lb-section-title button,
  .lb-overlay,
  .line-board a,
  .lb-person button,
  .lb-primary {
    display: none !important;
  }
  .lb-layout,
  .lb-bottom {
    display: block;
  }
  .lb-bath,
  .lb-panel,
  .lb-powder {
    break-inside: avoid;
    margin: 15px 0;
  }
  .lb-line-state {
    color: black;
    background: #eee;
  }
  .lb-line-state span,
  .lb-line-state small {
    color: #333;
  }
}
.lb-powder-column {
  position: relative;
  background: var(--surface-2);
  overflow: hidden;
}
.lb-powder-fill {
  position: absolute;
  bottom: 0;
  width: 100%;
  background: repeating-linear-gradient(
    0deg,
    var(--cs-accent-soft),
    var(--cs-accent-soft) 17px,
    var(--surface-2) 18px
  );
  transition: height 0.3s;
}
.lb-powder-column span {
  position: relative;
  z-index: 1;
  font-size: 10px;
}
.lb-time-field {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.line-board.lb-modal-form {
  min-height: 0;
  max-height: none;
  box-shadow: none;
  padding: 0;
  background: var(--cs-surface);
  border-radius: 0;
  overflow: visible;
}
.line-board.lb-modal-form label {
  margin: 10px 0;
}

.lb-selector-label { font-size: 12px; font-weight: 700; color: var(--ink-2); }
#production-line-selector { min-width: 190px; }
.line-board .lb-empty { background: var(--cs-surface); border: 1px dashed var(--lb-border); border-radius: 12px; padding: 28px 20px; text-align: center; }
.line-board .lb-empty a { display: inline-block; margin-top: 10px; font-weight: 700; }
@media (max-width: 640px) {
  .lb-top { align-items: stretch; gap: 16px; }
  .lb-toolbar { width: 100%; justify-content: flex-start; gap: 8px; }
  .lb-selector-label { width: 100%; }
  #production-line-selector { min-width: 0; width: 100%; }
  .lb-line-state { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 16px; }
  .lb-bath-grid { grid-template-columns: minmax(0, 1fr); }
  .lb-time-field { grid-template-columns: minmax(0, 1fr); }
}

/* Same operational renderer in office, industrial and read-only wall display. */
.line-board { width: 100%; min-width: 0; }
.line-board .lb-layout > *, .line-board .lb-bottom > *, .line-board .lb-bath { min-width: 0; }
.line-board p, .line-board dd, .line-board strong { overflow-wrap: anywhere; }
.line-board .lb-toolbar { flex-wrap: wrap; }
.line-board .lb-actions button { white-space: normal; height: auto; min-height: 40px; }
.line-board.lb-display { max-width: none; }
.line-board.lb-display:fullscreen { overflow-y: auto; background: var(--cs-surface); padding: 24px; }
.lb-display .lb-history, .lb-display .lb-bottom > section:nth-child(2) { display: none; }
.lb-display .lb-bath h3 { font-size: 24px; }
.lb-display .lb-bath dl, .lb-display .lb-person { font-size: 18px; }
.lb-display .lb-bath-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.lb-display .lb-note { font-size: 14px !important; }
[data-paya-profile="industrial"] .line-board button,
[data-paya-profile="industrial"] .line-board select,
[data-paya-profile="industrial"] .line-board input,
.line-board.lb-display .lb-toolbar button, .line-board.lb-display .lb-toolbar select { min-height: 56px !important; min-width: 56px; height: auto !important; max-height: none !important; font-size: 16px; }
[data-paya-profile="industrial"] .line-board .lb-actions { gap: 8px; }
@media (max-width: 600px) {
  .lb-display .lb-bath h3 { font-size: 20px; }
  .lb-display .lb-bath dl { font-size: 16px; }
  .line-board .lb-toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .line-board .lb-toolbar > label, .line-board .lb-toolbar > select { grid-column: 1 / -1; }
  .line-board .lb-toolbar button { width: 100%; min-width: 0; white-space: normal; }
  .line-board .lb-toolbar button:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

.lb-setup-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.lb-setup .lb-panel { min-width: 0; }
.lb-setup .lb-tank-empty { background: var(--surface-2); min-height: 120px; height: 120px; }
.lb-setup .lb-tank-empty strong { position: static; color: var(--ink-2); }
@media (max-width: 600px) { .lb-setup-grid { grid-template-columns: minmax(0, 1fr); } }
