.lts-page,
.lts-wrap {
  display: grid;
  gap: 16px;
}

.lts-overlay.page {
  padding: 0;
}

.layout-labtech main.staff-page.lts-hidden,
html[data-lt-hold="settings"] .layout-labtech main.staff-page {
  display: none !important;
}

.lts-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.lts-head h1 {
  margin: 0 0 4px;
  font-size: 1.45rem;
}

.lts-head p {
  margin: 0;
  color: #64748b;
}

.lts-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff7ed;
  color: #c2410c;
  font-size: 12px;
  font-weight: 700;
}

.lts-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lts-tabs button {
  border: 1px solid #d5e3e8;
  background: #fff;
  color: #0f3d3a;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
}

.lts-tabs button.on {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
}

.lts-grid {
  display: grid;
  gap: 16px;
}

.lts-card {
  background: #fff;
  border: 1px solid #e3ecee;
  border-radius: 16px;
  padding: 18px;
  display: grid;
  gap: 12px;
  box-shadow: 0 1px 2px rgba(15, 42, 44, 0.04);
}

.lts-card h2,
.lts-card h3 {
  margin: 0;
}

.lts-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.lts-fields label,
.lts-card > label,
.lts-dept label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}

.lts-fields .span-2 {
  grid-column: 1 / -1;
}

.lts-fields input,
.lts-fields textarea,
.lts-card textarea,
.lts-dept input {
  border: 1px solid #d5e1de;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  color: #0f2a2c;
  background: #fff;
}

.lts-check {
  display: flex !important;
  align-items: center;
  gap: 8px;
  font-weight: 650 !important;
  color: #0f2a2c !important;
}

.lts-pads,
.lts-sigs,
.lts-depts {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.lts-pad,
.lts-sig,
.lts-dept {
  border: 1px solid #e8eef0;
  border-radius: 14px;
  padding: 12px;
  display: grid;
  gap: 10px;
  background: #f8fbfb;
}

.lts-pad header {
  display: grid;
  gap: 2px;
}

.lts-pad header small,
.lts-sig-who small {
  color: #94a3b8;
  font-weight: 500;
}

.lts-pad-preview,
.lts-sig-preview {
  min-height: 72px;
  border-radius: 10px;
  background: #fff;
  border: 1px dashed #cbd5e1;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 8px;
}

.lts-sig-preview.sm {
  min-height: 56px;
}
.lts-sig-preview.report-box {
  min-height: 88px;
  align-content: end;
  gap: 6px;
  padding-bottom: 10px;
}
.lts-sig-line {
  width: 100%;
  border-top: 2px solid #0f766e;
  margin-top: 4px;
}
.lts-dept header small {
  display: block;
  color: #94a3b8;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.lts-pad-preview img,
.lts-sig-preview img {
  max-width: 100%;
  max-height: 96px;
  object-fit: contain;
}

.lts-pad-preview span,
.lts-sig-preview span {
  color: #94a3b8;
  font-size: 12px;
}

.lts-file {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #0f766e;
  cursor: pointer;
}

.lts-file input {
  max-width: 180px;
  font-size: 12px;
}

.lts-sig-who {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lts-sig-who img,
.lts-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  object-fit: cover;
  background: #ccfbf1;
  color: #0f766e;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.lts-sig-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.lts-status {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 12px;
}

.lts-status.ok {
  background: #ecfdf5;
  color: #047857;
}

.lts-status.warn {
  background: #fff7ed;
  color: #c2410c;
}

.lts-status small {
  opacity: 0.85;
}

@media (max-width: 760px) {
  .lts-fields {
    grid-template-columns: 1fr;
  }
}

/* Report Page Management */
.rpm-editor-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 18px;
  background: linear-gradient(135deg, #f5f3ff 0%, #ecfeff 100%);
  border: 1px solid #ddd6fe;
}
.rpm-editor-cta h2 { margin: 0 0 4px; font-size: 1.15rem; color: #4c1d95; }
.rpm-editor-cta p { margin: 0; color: #475569; font-size: 0.9rem; max-width: 52rem; }
.rpm-board { display: grid; gap: 14px; }
.rpm-title { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.rpm-title h2 { margin: 0 0 4px; font-size: 1.2rem; }
.rpm-title p { margin: 0; color: #64748b; font-size: 0.9rem; }
.rpm-branch { display: grid; gap: 4px; font-size: 12px; font-weight: 700; color: #475569; }
.rpm-branch select { min-width: 180px; border: 1px solid #d5e1de; border-radius: 10px; padding: 8px 10px; font: inherit; }
.rpm-grid { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(280px, 1.2fr) minmax(220px, 0.9fr); gap: 14px; align-items: start; }
.rpm-grid-simple { grid-template-columns: minmax(280px, 1fr) minmax(300px, 1.1fr); }
.rpm-config-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.rpm-config-card {
  display: grid; gap: 4px; text-align: left; border: 1px solid #dfe8e6; border-radius: 12px;
  padding: 12px 14px; background: #f8fbfb; cursor: pointer; font: inherit; color: inherit;
}
.rpm-config-card b { font-size: 0.92rem; color: #0f3d3a; }
.rpm-config-card span { font-size: 0.8rem; color: #64748b; }
.rpm-config-card.on { border-color: #5b21b6; background: #f5f3ff; box-shadow: 0 0 0 1px #5b21b6; }
.rpm-config-card.on b { color: #5b21b6; }
@media (max-width: 700px) { .rpm-config-grid { grid-template-columns: 1fr; } }
.rpm-col h3 { margin: 0 0 10px; font-size: 1rem; }
.rpm-field { display: grid; gap: 8px; margin-bottom: 14px; }
.rpm-field > span { font-size: 12px; font-weight: 700; color: #475569; text-transform: uppercase; letter-spacing: 0.02em; }
.rpm-choice { display: grid; gap: 8px; }
.rpm-choice label { display: grid; gap: 2px; border: 1px solid #dfe8e6; border-radius: 12px; padding: 10px 12px; cursor: pointer; background: #f8fbfb; }
.rpm-choice label.on { border-color: #0f766e; background: #ecfdf5; }
.rpm-choice small { color: #64748b; font-weight: 500; }
.rpm-hf-row, .rpm-margins { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rpm-hf-row b, .rpm-side-block b { display: block; margin-bottom: 4px; }
.rpm-mini-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.rpm-checks { display: grid; gap: 6px; }
.rpm-preview-toggle { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.rpm-preview-toggle button { border: 1px solid #d5e3e8; background: #fff; border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 0.8rem; cursor: pointer; }
.rpm-preview-toggle button.on { background: #0f766e; border-color: #0f766e; color: #fff; }
.rpm-a4 { width: 100%; max-width: 420px; margin: 0 auto; background: #fff; border: 1px solid #d7e2e0; box-shadow: 0 10px 30px rgba(15,42,44,0.08); min-height: 560px; display: flex; flex-direction: column; overflow: hidden; }
.rpm-a4-header, .rpm-a4-footer { background: #f8fafc; border-bottom: 1px solid #e2e8f0; }
.rpm-a4-footer { border-bottom: 0; border-top: 1px solid #e2e8f0; margin-top: auto; padding: 6px; text-align: center; font-size: 10px; color: #64748b; }
.rpm-a4-header img, .rpm-a4-footer img { width: 100%; display: block; height: auto; object-fit: contain; object-position: top; }
.rpm-a4-header-fallback { padding: 10px 12px; display: grid; gap: 2px; }
.rpm-a4-body { padding: 12px; flex: 1; font-size: 11px; }
.rpm-a4-body h3 { margin: 0 0 8px; font-size: 13px; color: #0f3d3a; }
.rpm-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; margin-bottom: 10px; padding: 8px; border: 1px solid #e2e8f0; border-radius: 8px; }
.rpm-a4-body table { width: 100%; border-collapse: collapse; }
.rpm-a4-body th, .rpm-a4-body td { border-bottom: 1px solid #edf2f1; padding: 5px 3px; text-align: left; }
.rpm-a4-body th { font-size: 10px; text-transform: uppercase; color: #64748b; }
.rpm-disc { margin-top: 10px; font-size: 10px; color: #64748b; }
.rpm-side-block { border: 1px solid #e8eef0; border-radius: 12px; padding: 12px; background: #f8fbfb; display: grid; gap: 8px; margin-bottom: 12px; }
.rpm-side-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rpm-switch { position: relative; width: 42px; height: 24px; }
.rpm-switch input { opacity: 0; width: 0; height: 0; }
.rpm-switch span { position: absolute; inset: 0; background: #cbd5e1; border-radius: 999px; cursor: pointer; transition: .2s; }
.rpm-switch span:before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.rpm-switch input:checked + span { background: #0f766e; }
.rpm-switch input:checked + span:before { transform: translateX(18px); }
.rpm-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; padding-top: 4px; }
.emp-btn.accent { background: #5b21b6; border-color: #5b21b6; color: #fff; }
.rpm-apply { display: grid; gap: 6px; }
.rpm-apply select { min-width: 180px; border: 1px solid #d5e1de; border-radius: 10px; padding: 6px; font: inherit; }
.rpm-edit-modal { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: grid; place-items: center; z-index: 80; padding: 16px; }
.rpm-edit-card { width: min(520px, 100%); max-height: 90vh; overflow: auto; }
@media (max-width: 1100px) {
  .rpm-grid { grid-template-columns: 1fr; }
}

.rtm { display: grid; gap: 12px; }
.rtm-head, .rtm-center-head, .rtm-art-actions, .rtm-actions { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.rtm-head h2, .rtm h3 { margin: 0; }
.rtm-head p, .rtm-help { margin: 4px 0 0; color: #64748b; font-size: 13px; }
.rtm-views { display: flex; gap: 8px; flex-wrap: wrap; }
.rtm-views button, .rtm-toggle button, .rtm-lab, .rtm-format, .rtm-config {
  border: 1px solid #e2e8f0; background: #fff; border-radius: 12px; padding: 8px 12px; font: inherit; cursor: pointer; text-align: left;
}
.rtm-views button.on, .rtm-toggle button.on, .rtm-lab.on, .rtm-format.on, .rtm-config.on {
  background: #6d28d9; border-color: #6d28d9; color: #fff;
}
.rtm-grid { display: grid; grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.2fr) minmax(240px, 0.8fr); gap: 12px; align-items: start; }
.rtm-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 14px; display: grid; gap: 10px; }
.rtm-card h3 { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.rtm-card h3 span { width: 22px; height: 22px; border-radius: 999px; background: #ede9fe; color: #6d28d9; display: inline-grid; place-items: center; font-size: 12px; }
.rtm-labs, .rtm-formats, .rtm-art-row, .rtm-split { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rtm-formats.three { grid-template-columns: 1fr; }
@media (min-width: 1100px) {
  .rtm-formats.three { grid-template-columns: 1fr; }
}
.rtm-lab small, .rtm-format small, .rtm-art-row small, .rtm-config span { display: block; color: #64748b; font-size: 12px; }
.rtm-lab.on small, .rtm-format.on small { color: #ede9fe; }
.rtm-num { display: grid; gap: 4px; font-size: 12px; font-weight: 700; color: #475569; }
.rtm-num input, .rtm-num select, .rtm-branch-fixed { border: 1px solid #d5dee8; border-radius: 8px; padding: 7px 8px; font: inherit; font-weight: 500; }
.rtm-branch-fixed { background: #f8fafc; color: #0f172a; }
.rtm-thumb { height: 64px; border: 1px dashed #c4b5fd; border-radius: 10px; overflow: hidden; background: #fff; display: grid; }
.rtm-thumb img, .rtm-band img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.rtm-thumb.empty, .rtm-art-empty { display: grid; place-items: center; color: #94a3b8; font-size: 12px; }
.rtm-sheet {
  width: min(100%, 420px); margin: 0 auto; aspect-ratio: 210 / 297; background: #fff;
  border: 1px solid #d7e2e0; box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  display: grid; grid-template-rows: var(--rtm-top) 1fr var(--rtm-bottom);
  position: relative;
}
.rtm-band { overflow: hidden; background: #fff; }
/* 1mm clear space under footer artwork (padding % is relative to sheet width = 210mm). */
.rtm-band.bottom {
  box-sizing: border-box;
  padding-bottom: calc(100% / 210);
}
.rtm-body { padding: 8px var(--rtm-right) 8px var(--rtm-left); font-size: 10px; overflow: hidden; }
.rtm-body h4 { margin: 6px 0; text-align: center; font-size: 11px; color: #0f766e; }
.rtm-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 8px; }
.rtm-body table { width: 100%; border-collapse: collapse; }
.rtm-body th, .rtm-body td { border-bottom: 1px solid #e2e8f0; padding: 3px 2px; text-align: left; }
.rtm-note, .rtm-page { color: #64748b; font-size: 12px; }
.rtm-config-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rtm-center-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.rtm-print-frame { display: grid; gap: 8px; }
.rtm-print-frame iframe { width: 100%; height: 720px; border: 1px solid #d7e2e0; border-radius: 12px; background: #fff; }
.rtm-actions, .rtm-apply { display: grid; gap: 8px; }
.rtm-library { display: grid; gap: 8px; }
.rtm-library.large { grid-template-columns: 1fr 1fr; }
.rtm-library > h3, .rtm-library > p { grid-column: 1 / -1; }
.rtm-lib-card { display: grid; grid-template-columns: 78px 1fr; gap: 8px; align-items: center; border: 1px solid #e2e8f0; border-radius: 12px; padding: 8px; background: #fff; text-align: left; cursor: pointer; }
.rtm-lib-card.on { border-color: #6d28d9; box-shadow: 0 0 0 1px #6d28d9; }
.rtm-lib-copy { display: grid; gap: 2px; min-width: 0; }
.rtm-lib-copy b { font-size: 13px; color: #0f172a; }
.rtm-lib-copy small { color: #64748b; font-size: 11px; }
.rtm-lib-copy span { color: #6d28d9; font-size: 12px; font-weight: 700; }
.rtm-lib-preview .rtm-sheet { width: 78px; box-shadow: none; }
.rtm-lib-preview .rtm-body { font-size: 0; background: #f8fafc; }
.rtm-lib-preview .rtm-body * { display: none; }
.rtm-library.large .rtm-lib-card { grid-template-columns: 120px 1fr; }
.rtm-library.large .rtm-lib-preview .rtm-sheet { width: 120px; }
.rtm-side { display: grid; gap: 12px; min-width: 0; }
.rtm-side .rtm-card { padding: 0 0 14px; overflow: hidden; gap: 12px; }
.rtm-panel-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; background: #f5f3ff; border-bottom: 1px solid #ede9fe; }
.rtm-panel-head h3 { margin: 0; font-size: 15px; color: #1e1b4b; }
.rtm-ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: #ede9fe; color: #6d28d9; }
.rtm-chev { margin-left: auto; color: #7c3aed; display: grid; transition: transform .15s ease; }
button.rtm-lib-toggle { width: 100%; border: 0; cursor: pointer; font: inherit; text-align: left; color: inherit; }
button.rtm-lib-toggle:hover { background: #ede9fe; }
.rtm-lib-body { display: grid; gap: 12px; }
.rtm-library-card.is-shut { padding-bottom: 0; }
.rtm-library-card.is-shut .rtm-lib-body { display: none; }
.rtm-library-card.is-shut .rtm-panel-head { border-bottom: 0; }
.rtm-library-card.is-shut .rtm-chev { transform: rotate(180deg); }
.rtm-side .rtm-num, .rtm-spec, .rtm-side .rtm-actions, .rtm-info, .rtm-side .rtm-help { margin-left: 14px; margin-right: 14px; }
.rtm-side .rtm-num input { height: 40px; border-radius: 10px; background: #fff; }
.rtm-spec { display: grid; gap: 2px; }
.rtm-spec p { margin: 0; color: #334155; font-size: 13px; }
.rtm-side .rtm-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.rtm-side .rtm-tool, .rtm-side .rtm-save { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; border-radius: 12px; font-weight: 700; font-size: 13px; padding: 8px 8px; cursor: pointer; }
.rtm-side .rtm-tool { background: #fff; border: 1px solid #e2e8f0; color: #334155; }
.rtm-side .rtm-save { background: #7c3aed; border: 1px solid #7c3aed; color: #fff; }
.rtm-info { display: flex; gap: 8px; align-items: flex-start; margin: 0 14px; padding: 10px 12px; border-radius: 12px; background: #eff6ff; color: #2563eb; font-size: 13px; }
.rtm-info span { color: #1e3a8a; }
.rtm-info .rtm-svg { flex: none; margin-top: 1px; }
.rtm-library-card .rtm-lib-card { margin: 0 14px; border-radius: 14px; background: #fff; }
.rtm-library-card .rtm-lib-card.on { background: #f5f3ff; border-color: #7c3aed; box-shadow: none; }
.rtm-view { display: inline-flex; align-items: center; gap: 6px; color: #7c3aed; font-size: 12px; font-weight: 700; margin-top: 2px; }
@media (max-width: 1280px) { .rtm-side .rtm-actions { grid-template-columns: 1fr 1fr; } }
@media (max-width: 1100px) {
  .rtm-grid, .rtm-labs, .rtm-formats, .rtm-art-row, .rtm-config-list, .rtm-library.large { grid-template-columns: 1fr; }
}

/* LIS Settings */
.lts-lis-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.lts-lis-head h2 { margin: 0; }
.lts-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.lts-pill.ok { background: #ecfdf5; color: #047857; }
.lts-pill.warn { background: #fff7ed; color: #c2410c; }
.lts-lis-grid {
  display: grid;
  gap: 12px;
}
.lts-field {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}
.lts-field input {
  width: 100%;
  border: 1px solid #d5e3e8;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-weight: 500;
  background: #f8fafc;
  color: #0f172a;
}
.lts-secret-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
}
.lts-secret-row input { min-width: 0; }
.lts-lis-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.lts-lis-help {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 14px;
  background: #f8fafc;
}
.lts-lis-help summary {
  cursor: pointer;
  font-weight: 700;
  color: #0f766e;
}
.lts-lis-help ol {
  margin: 10px 0 0;
  padding-left: 18px;
  color: #475569;
  font-size: 13px;
  font-weight: 500;
}
@media (max-width: 720px) {
  .lts-secret-row { grid-template-columns: 1fr; }
}

/* LIS Machines, Signals & Real-Time Logs */
.lts-lis-stack { display: grid; gap: 16px; }
.lts-lis-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.lts-lis-bar h3 { margin: 0; font-size: 16px; color: #0f172a; }
.lts-lis-summary { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 12px; color: #475569; }
.lts-m-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 12px; }
.lts-m-card { border: 1px solid #e2e8f0; border-radius: 14px; padding: 14px; background: #fff; display: grid; gap: 10px; }
.lts-m-card.sig-online { border-color: #86efac; background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 34%); }
.lts-m-card.sig-listening { border-color: #fcd34d; background: linear-gradient(180deg, #fffbeb 0%, #ffffff 34%); }
.lts-m-card.sig-error { border-color: #fca5a5; background: linear-gradient(180deg, #fef2f2 0%, #ffffff 34%); }
.lts-m-card.sig-disabled { opacity: .68; background: #f8fafc; }
.lts-m-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.lts-m-title { display: grid; gap: 2px; min-width: 0; }
.lts-m-title b { font-size: 15px; color: #0f172a; }
.lts-m-title small { font-size: 12px; color: #64748b; }
.lts-sig { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.lts-sig-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.lts-sig.online { background: #dcfce7; color: #166534; }
.lts-sig.online .lts-sig-dot { background: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, .22); animation: ltsPulse 1.8s infinite; }
.lts-sig.listening { background: #fef3c7; color: #92400e; }
.lts-sig.listening .lts-sig-dot { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .2); }
.lts-sig.offline { background: #fee2e2; color: #991b1b; }
.lts-sig.offline .lts-sig-dot { background: #dc2626; }
.lts-sig.error { background: #fee2e2; color: #991b1b; }
.lts-sig.error .lts-sig-dot { background: #dc2626; animation: ltsPulse 1.2s infinite; }
.lts-sig.disabled { background: #e2e8f0; color: #475569; }
.lts-sig.disabled .lts-sig-dot { background: #94a3b8; }
@keyframes ltsPulse { 0% { opacity: 1; } 50% { opacity: .45; } 100% { opacity: 1; } }

.lts-m-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.lts-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 8px; font-size: 11px; font-weight: 700; background: #f1f5f9; color: #334155; }
.lts-chip.proto { background: #ede9fe; color: #5b21b6; }
.lts-chip.detected { background: #dcfce7; color: #047857; }
.lts-m-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; font-size: 12px; color: #475569; }
.lts-m-meta span b { color: #0f172a; font-weight: 600; }
.lts-m-err { font-size: 12px; color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; padding: 6px 8px; }
.lts-m-actions { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 6px; border-top: 1px solid #f1f5f9; }
.lts-m-actions .emp-btn { padding: 5px 10px; font-size: 12px; min-height: 30px; }

/* Modal overlay (Machine form + Real-Time Logs) */
.lts-modal-bg { position: fixed; inset: 0; z-index: 99999; background: rgba(15, 23, 42, .55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.lts-modal { width: 100%; max-width: 640px; max-height: 90vh; background: #fff; border-radius: 16px; box-shadow: 0 24px 60px rgba(15, 23, 42, .28); display: flex; flex-direction: column; overflow: hidden; }
.lts-modal.wide { max-width: 960px; }
.lts-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid #e2e8f0; background: #f8fafc; }
.lts-modal-head h3 { margin: 0; font-size: 16px; color: #0f172a; }
.lts-modal-body { padding: 16px 18px; overflow: auto; display: grid; gap: 12px; }
.lts-modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid #e2e8f0; background: #f8fafc; }
.lts-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.lts-preset { border: 1px solid #cbd5e1; background: #f8fafc; color: #334155; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600; cursor: pointer; }
.lts-preset:hover { border-color: #0d9488; color: #0f766e; background: #f0fdfa; }
.lts-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lts-form-grid .full { grid-column: 1 / -1; }
.lts-form-grid label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: #334155; }
.lts-form-grid input, .lts-form-grid select { border: 1px solid #cbd5e1; border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13px; background: #fff; color: #0f172a; }
.lts-form-grid .chk { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.lts-form-grid .chk input { width: 16px; height: 16px; }

/* Real-Time Log Terminal */
.lts-log-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lts-log-bar select { border: 1px solid #cbd5e1; border-radius: 8px; padding: 6px 10px; font-size: 12px; background: #fff; }
.lts-log-live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: #166534; background: #dcfce7; padding: 4px 10px; border-radius: 999px; }
.lts-log-live.paused { background: #fef3c7; color: #92400e; }
.lts-log-box { background: #0f172a; color: #e2e8f0; border-radius: 12px; padding: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.55; height: 420px; overflow: auto; }
.lts-log-line { display: flex; gap: 8px; padding: 2px 0; border-bottom: 1px solid rgba(148, 163, 184, .1); word-break: break-word; }
.lts-log-ts { color: #94a3b8; flex: none; }
.lts-log-src { color: #38bdf8; flex: none; font-weight: 700; }
.lts-log-src.server { color: #a78bfa; }
.lts-log-lvl { flex: none; font-weight: 700; min-width: 48px; }
.lts-log-lvl.INFO { color: #4ade80; }
.lts-log-lvl.WARNING, .lts-log-lvl.WARN { color: #fbbf24; }
.lts-log-lvl.ERROR { color: #f87171; }
.lts-log-mc { color: #2dd4bf; flex: none; font-weight: 700; }
.lts-log-proto { color: #f472b6; flex: none; font-weight: 700; }
.lts-log-msg { color: #f1f5f9; flex: 1; }

/* Built-in LIS Bridge card */
.lts-bridge-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border-radius: 12px; border: 1px solid #cbd5e1; background: #f8fafc; margin-bottom: 12px; }
.lts-bridge-box.on { border-color: #86efac; background: #f0fdf4; }
.lts-bridge-box.browser { border-color: #bae6fd; background: #f0f9ff; }
.lts-bridge-info { display: grid; gap: 8px; flex: 1; min-width: 260px; }
.lts-bridge-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lts-bridge-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: #475569; }
.lts-bridge-meta b { color: #0f172a; }
.lts-bridge-auto { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: #334155; cursor: pointer; }
.lts-bridge-auto input { width: 15px; height: 15px; }
.emp-btn.danger { background: #dc2626; border-color: #dc2626; color: #fff; }
.emp-btn.danger:hover { background: #b91c1c; }

/* Server PC & Client PC LAN Connection Checker (Row table) */
.lts-pc-wrap { width: 100%; overflow-x: auto; border: 1px solid #e2e8f0; border-radius: 12px; }
.lts-pc-table { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
.lts-pc-table th { text-align: left; padding: 10px 12px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: #64748b; background: #f8fafc; border-bottom: 1px solid #e2e8f0; }
.lts-pc-table td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.lts-pc-table tr:last-child td { border-bottom: none; }
.lts-pc-row.sig-online { background: #fcfffd; }
.lts-pc-row.sig-offline { background: #fffafa; }
.lts-role-badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .03em; }
.lts-role-badge.server { background: #0f766e; color: #fff; }
.lts-role-badge.client { background: #e2e8f0; color: #334155; }
.lts-pc-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.lts-pc-name small { width: 100%; font-size: 11.5px; color: #64748b; }
.lts-pc-ip { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; background: #f1f5f9; padding: 3px 7px; border-radius: 6px; color: #0f172a; }
.lts-pc-detail { font-size: 11px; color: #64748b; margin-top: 2px; }
.lts-pc-age { font-size: 12px; color: #334155; white-space: nowrap; }
.lts-pc-age small { display: block; font-size: 11px; color: #64748b; }
.lts-pc-acts { display: flex; gap: 5px; white-space: nowrap; }
.lts-sig.unknown { background: #f1f5f9; color: #64748b; }
.lts-sig.unknown .lts-sig-dot { background: #94a3b8; }

@media (max-width: 680px) {
  .lts-form-grid { grid-template-columns: 1fr; }
}
