:root {
  color-scheme: light;
  --canvas: #edf1f4;
  --panel: #ffffff;
  --panel-soft: #f7f9fb;
  --line: #d8dee6;
  --line-strong: #b9c4d0;
  --text: #18212b;
  --muted: #667384;
  --brand: #0d7868;
  --brand-dark: #075f53;
  --brand-soft: #eaf7f3;
  --blue: #245ad6;
  --blue-soft: #edf3ff;
  --orange: #b45309;
  --orange-soft: #fff5e8;
  --red: #c43737;
  --red-soft: #fff0f0;
  --shadow: 0 10px 28px rgba(24, 33, 43, 0.09);
  --font: "Inter", "MiSans", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--canvas);
  color: var(--text);
  font: 14px/1.45 var(--font);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(36, 90, 214, 0.2);
  outline-offset: 1px;
}

svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  flex: 0 0 auto;
}

.hidden {
  display: none !important;
}

[hidden] {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 88px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 100vh;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  background: #fff;
  border-right: 1px solid var(--line);
}

body.sidebar-collapsed .sidebar {
  display: grid;
}

.brand {
  min-height: 74px;
  padding: 12px 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #fff;
  background: var(--brand);
}

.brand-mark svg {
  width: 22px;
  height: 22px;
}

.brand-copy {
  display: none;
}

.brand-copy strong {
  font-size: 16px;
}

.brand-copy span {
  color: var(--muted);
  font-size: 11px;
}

.station-select {
  width: 52px;
  margin: 10px auto;
  min-height: 54px;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
}

.station-select > svg {
  color: var(--brand);
}

.station-select > svg:last-child {
  display: none;
}

.station-select div {
  display: none;
}

.station-select span {
  color: var(--muted);
  font-size: 10px;
}

.station-select strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.nav-list {
  padding: 4px 10px;
  display: grid;
  gap: 4px;
  align-content: start;
}

.nav-item {
  width: 100%;
  min-height: 52px;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #34404d;
  text-align: left;
  font-weight: 700;
}

.nav-item:hover {
  background: #f3f6f8;
}

.nav-item.active {
  border-color: #b8ddd5;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.nav-item kbd {
  min-width: 19px;
  padding: 1px 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--muted);
  font: 10px/1.4 var(--mono);
  text-align: center;
}

.nav-item span,
.nav-item kbd {
  display: none;
}

.nav-item svg {
  width: 21px;
  height: 21px;
}

.sidebar-footer {
  border-top: 1px solid var(--line);
  padding: 8px 10px;
  display: grid;
  gap: 8px;
}

.printer-mini {
  min-width: 0;
  padding: 8px 7px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  place-items: center;
}

.printer-mini > div {
  display: none;
}

.printer-mini strong,
.printer-mini span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.printer-mini strong {
  font-size: 12px;
}

.printer-mini div span {
  color: var(--muted);
  font-size: 10px;
}

.prototype-note {
  width: 48px;
  min-height: 31px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid #dfc79f;
  border-radius: 5px;
  background: var(--orange-soft);
  color: #8b4b0f;
  font-size: 11px;
  font-weight: 800;
}

.prototype-note svg {
  width: 15px;
}

.prototype-note span {
  display: none;
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  height: 74px;
  padding: 0 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
}

.page-heading {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-heading > div {
  min-width: 0;
}

.breadcrumb {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  margin-top: 1px;
  font-size: 21px;
  line-height: 1.2;
}

h2 {
  font-size: 17px;
  line-height: 1.3;
}

h3 {
  font-size: 14px;
}

.top-actions,
.inline-actions,
.result-actions,
.printer-strip-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.connection-button {
  min-height: 48px;
  padding: 6px 10px;
  display: grid;
  grid-template-columns: auto auto auto;
  gap: 9px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

.connection-button:hover {
  border-color: #99bdb5;
  background: #fbfefd;
}

.connection-copy {
  display: grid;
  text-align: left;
}

.connection-copy strong {
  font-size: 12px;
}

.connection-copy small {
  color: var(--muted);
  font-size: 10px;
}

.status-dot {
  width: 9px;
  height: 9px;
  display: inline-block;
  border-radius: 50%;
  background: #8c98a5;
  box-shadow: 0 0 0 3px rgba(140, 152, 165, 0.13);
}

.status-dot.connected {
  background: #15966f;
  box-shadow: 0 0 0 3px rgba(21, 150, 111, 0.13);
}

.status-dot.error {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(196, 55, 55, 0.13);
}

.icon-btn,
.tool-btn {
  position: relative;
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #394654;
}

.icon-btn:hover,
.tool-btn:hover {
  border-color: var(--line-strong);
  background: var(--panel-soft);
}

.mobile-menu {
  display: none;
}

.notification-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 6px;
  height: 6px;
  border: 1px solid #fff;
  border-radius: 50%;
  background: var(--red);
}

.avatar {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #243240;
  color: #fff;
  font-weight: 800;
}

.page {
  display: none;
  padding: 18px 24px 30px;
}

.page.active {
  display: block;
}

.printer-strip {
  min-height: 48px;
  padding: 8px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  background: #fff;
}

.printer-strip-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
}

.printer-strip-main > span:not(.status-dot):not(.separator) {
  color: var(--muted);
}

.printer-strip-main svg {
  width: 16px;
  color: var(--blue);
}

.printer-profile-control {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.printer-profile-control select {
  min-height: 32px;
  padding: 4px 28px 4px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--text);
  font-weight: 750;
}

.separator {
  width: 1px;
  height: 20px;
  margin: 0 4px;
  background: var(--line);
}

.text-btn {
  min-height: 32px;
  padding: 5px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--blue);
  font-weight: 750;
}

.text-btn:hover {
  background: var(--blue-soft);
}

.text-btn svg {
  width: 15px;
}

.text-btn.danger {
  color: var(--red);
}

.text-btn.danger:hover {
  background: var(--red-soft);
}

.workbench-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 14px;
  align-items: start;
}

body.preview-collapsed .workbench-grid {
  grid-template-columns: minmax(0, 1fr);
}

body.preview-collapsed .preview-column {
  display: none;
}

.workflow-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  background: #fff;
}

.scan-section {
  order: 1;
}

.print-content-section {
  order: 2;
}

.sample-results-section {
  order: 3;
}

.queue-section {
  order: 4;
}

.scan-section,
.result-section,
.print-content-section,
.queue-section {
  padding: 18px;
}

.scan-section,
.result-section,
.print-content-section {
  border-bottom: 1px solid var(--line);
}

.section-heading {
  margin-bottom: 15px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.section-heading.compact {
  margin-bottom: 11px;
  align-items: center;
}

.section-heading > div:first-child {
  min-width: 0;
}

.section-kicker {
  display: block;
  margin-bottom: 3px;
  color: var(--brand);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.result-summary {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.sample-results-section.collapsed {
  padding-block: 12px;
  background: #f8fafb;
}

.sample-results-section.collapsed .section-heading {
  margin-bottom: 0;
}

.sample-results-section.collapsed .sample-results-body,
.sample-results-section.collapsed #refreshResultsBtn {
  display: none;
}

.sample-results-body {
  padding-top: 2px;
}

.sample-count-badge {
  min-width: 26px;
  height: 24px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.sample-disclosure-toggle svg {
  width: 15px;
  transition: transform 160ms ease;
}

.sample-disclosure-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.segmented button {
  min-height: 32px;
  padding: 0 11px;
  border: 0;
  border-right: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.segmented button:last-child {
  border-right: 0;
}

.segmented button.active {
  background: #243240;
  color: #fff;
}

.scan-input-wrap {
  min-height: 58px;
  padding: 6px 6px 6px 14px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  border: 2px solid #77b5a8;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(13, 120, 104, 0.06);
}

.scan-input-wrap > svg {
  width: 23px;
  height: 23px;
  color: var(--brand);
}

.scan-input-wrap input {
  width: 100%;
  min-width: 0;
  height: 42px;
  border: 0;
  outline: 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
}

.scan-input-wrap input::placeholder {
  color: #9aa5b1;
  font-weight: 600;
}

.clear-scan {
  width: 32px;
  height: 32px;
  border: 0;
  color: var(--muted);
}

.primary-btn,
.secondary-btn,
.print-btn {
  min-height: 38px;
  padding: 8px 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 6px;
  font-weight: 850;
}

.primary-btn {
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
}

.primary-btn:hover {
  border-color: var(--brand-dark);
  background: var(--brand-dark);
}

.secondary-btn {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
}

.secondary-btn:hover {
  border-color: #8e9cac;
  background: var(--panel-soft);
}

.secondary-btn.danger {
  border-color: #e0aaaa;
  color: var(--red);
}

.full {
  width: 100%;
}

.scan-input-wrap .primary-btn {
  min-width: 96px;
  min-height: 44px;
}

.scan-meta {
  margin-top: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
}

.scan-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.scan-meta svg {
  width: 14px;
}

.scan-meta-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.auto-print-control {
  color: var(--brand-dark);
}

.scan-ready {
  color: var(--brand-dark);
  font-weight: 800;
}

.query-status {
  color: var(--muted);
  font-weight: 750;
}

.query-status.good {
  color: var(--brand-dark);
}

.query-status.error {
  color: var(--red);
}

.query-status svg {
  animation: status-spin 0.9s linear infinite;
}

.query-status.good svg,
.query-status.error svg {
  animation: none;
}

@keyframes status-spin {
  to {
    transform: rotate(360deg);
  }
}

.check-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #45515e;
  font-size: 11px;
  font-weight: 750;
}

.check-control input {
  width: 15px;
  height: 15px;
  accent-color: var(--brand);
}

.result-toolbar {
  margin-bottom: 9px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 9px;
  align-items: center;
}

.sample-filter,
.label-filter {
  position: relative;
  display: block;
}

.sample-filter svg,
.label-filter svg {
  position: absolute;
  top: 50%;
  left: 9px;
  z-index: 1;
  width: 15px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.sample-filter input,
.label-filter input {
  padding-left: 31px;
}

.result-toolbar > span,
.page-size-control {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.page-size-control {
  display: flex;
  align-items: center;
  gap: 5px;
}

.page-size-control select {
  width: 66px;
  min-height: 34px;
  padding-block: 5px;
}

.result-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
}

.result-table-scroll {
  max-height: 292px;
  overflow: auto;
}

.result-table-scroll .result-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 12px;
}

.result-table th,
.result-table td {
  padding: 10px 11px;
  border-bottom: 1px solid #e4e8ed;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.result-table th {
  background: #f3f6f8;
  color: #526070;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.result-table tr:last-child td {
  border-bottom: 0;
}

.result-table tbody tr {
  cursor: pointer;
}

.result-table tbody tr:hover {
  background: #f7faf9;
}

.result-table tbody tr.selected {
  background: #edf8f5;
  box-shadow: inset 3px 0 0 var(--brand);
}

.result-table td strong,
.result-table td small {
  display: block;
}

.result-table td small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.select-col {
  width: 28px;
}

.row-radio {
  width: 16px;
  height: 16px;
  display: inline-block;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #fff;
}

.row-radio.active {
  border: 5px solid var(--brand);
}

.list-pagination {
  min-height: 42px;
  padding-top: 8px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.list-pagination > div {
  display: flex;
  gap: 6px;
}

.list-pagination .icon-btn {
  width: 32px;
  height: 32px;
}

.state-badge {
  min-height: 24px;
  padding: 3px 8px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f4f6f8;
  color: #5a6674;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.state-badge.ready {
  border-color: #a8d7ca;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.state-badge.warning {
  border-color: #e4c08e;
  background: var(--orange-soft);
  color: #8d4c0d;
}

.state-badge.error {
  border-color: #e6b0b0;
  background: var(--red-soft);
  color: var(--red);
}

.print-content-heading {
  align-items: flex-start;
}

.print-content-actions,
.manual-context-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.manual-context-bar {
  position: sticky;
  top: 84px;
  z-index: 8;
  min-height: 52px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 6px 16px rgba(24, 33, 43, 0.06);
}

.manual-context-bar > div:first-child {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.manual-context-bar > div:first-child > svg {
  width: 18px;
  color: var(--brand);
}

.manual-context-bar > div:first-child > div {
  display: grid;
}

.manual-context-bar > div:first-child span {
  color: var(--muted);
  font-size: 9px;
}

.manual-context-bar > div:first-child strong {
  font-size: 12px;
}

.apply-scope button {
  min-width: 98px;
}

.sequencing-mode-bar {
  min-height: 54px;
  margin-top: 8px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #9fd3c5;
  background: #f2faf7;
}

.sequencing-mode-bar[hidden] {
  display: none;
}

.sequencing-mode-copy,
.sequencing-mode-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sequencing-mode-copy > svg {
  width: 19px;
  color: var(--brand);
}

.sequencing-mode-copy > div {
  display: grid;
  gap: 2px;
}

.sequencing-mode-copy strong {
  font-size: 12px;
}

.sequencing-mode-copy span {
  color: var(--muted);
  font-size: 10px;
}

.sequencing-print-mode button {
  min-width: 104px;
}

.sequencing-customer-option {
  min-height: 34px;
  padding-inline: 9px;
  white-space: nowrap;
}

.sequencing-member-panel {
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  background: #fff;
}

.sequencing-member-panel[hidden] {
  display: none;
}

.sequencing-member-panel-head,
.sequencing-member-group header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sequencing-member-panel-head > div,
.sequencing-member-group header > div {
  display: grid;
  gap: 2px;
}

.sequencing-member-panel-head strong,
.sequencing-member-group strong {
  font-size: 12px;
}

.sequencing-member-panel-head span,
.sequencing-member-group header span,
.sequencing-member-group header small {
  color: var(--muted);
  font-size: 10px;
}

.sequencing-member-groups {
  max-height: 228px;
  margin-top: 9px;
  overflow: auto;
  border: 1px solid var(--line);
}

.sequencing-member-group {
  padding: 9px 10px;
}

.sequencing-member-group + .sequencing-member-group {
  border-top: 1px solid var(--line);
}

.sequencing-member-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.sequencing-member-chips > span {
  min-height: 24px;
  padding: 4px 7px;
  border: 1px solid #cfd9e4;
  background: #f7f9fb;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10px;
}

.sequencing-member-chips > .sequencing-member-empty {
  border-style: dashed;
  color: var(--muted);
  font-family: inherit;
}

.quick-print-btn {
  width: auto;
  min-width: 250px;
  min-height: 42px;
  margin: 0;
  padding-inline: 16px;
}

.box-print-btn {
  min-width: 126px;
  min-height: 42px;
  padding: 8px 12px;
  white-space: nowrap;
}

.active-purpose-bar {
  min-height: 48px;
  margin-top: 10px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #a8d7ca;
  background: #f4fbf9;
}

.active-purpose-bar.manual {
  border-color: #e0c18e;
  background: var(--orange-soft);
}

.active-purpose-bar.empty {
  border-color: var(--line);
  background: var(--panel-soft);
}

.active-purpose-bar > div {
  min-width: 0;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 7px;
  align-items: center;
}

.active-purpose-bar svg {
  width: 16px;
  color: var(--brand);
}

.active-purpose-bar.manual svg {
  color: var(--orange);
}

.active-purpose-bar.empty svg {
  color: var(--muted);
}

.active-purpose-bar > div > span {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.active-purpose-bar > div > strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manual-purpose-note {
  margin-top: 8px;
  min-height: 24px;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
}

.manual-purpose-note svg {
  width: 14px;
  color: var(--orange);
}

.category-selector {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.category-selector .category-tile {
  min-width: 0;
  min-height: 58px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: #45515e;
  text-align: left;
}

.category-selector .category-tile > svg {
  width: 18px;
  color: var(--muted);
}

.category-copy {
  min-width: 0;
  display: grid;
}

.category-copy strong {
  font-size: 11px;
}

.category-copy small {
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-count {
  min-width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #edf1f4;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
}

.category-selector .category-tile:hover {
  border-color: #82b8ad;
  background: #f8fcfb;
}

.category-selector .category-tile.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.category-selector .category-tile.active > svg,
.category-selector .category-tile.active .category-copy strong {
  color: var(--brand-dark);
}

.category-selector .category-tile.active .category-count {
  background: var(--brand);
  color: #fff;
}

.label-list-toolbar {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.label-list-toolbar > div {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.label-list-toolbar > div span {
  color: var(--muted);
  font-size: 10px;
}

.label-filter {
  width: min(260px, 45%);
}

.label-option-list {
  min-height: 280px;
  max-height: 58vh;
  margin-top: 8px;
  overflow: auto;
  border: 1px solid var(--line);
  background: #fff;
}

.label-option-group + .label-option-group {
  border-top: 1px solid var(--line);
}

.label-option-group-head {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 32px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: #f3f6f8;
}

.label-option-group-head strong {
  color: #44515f;
  font-size: 10px;
}

.label-option-group-head span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.label-option-group-grid {
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 7px;
  background: #f7f9fb;
}

.label-option {
  position: relative;
  min-width: 0;
  min-height: 72px;
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.label-option:hover {
  border-color: #9bc4bb;
  background: #f7faf9;
}

.label-option.selected {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.label-option-marker {
  grid-column: 2;
  grid-row: 1;
  width: 18px;
  height: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #fff;
}

.label-option.selected .label-option-marker {
  border: 5px solid var(--brand);
}

.label-option > span:last-child {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  display: grid;
}

.label-option strong {
  overflow: hidden;
  display: -webkit-box;
  min-height: 32px;
  font-size: 12px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.label-option small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.label-list-empty {
  min-height: 92px;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
}

.manual-selection-footer {
  min-height: 39px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.queue-row {
  min-height: 54px;
  padding: 7px 8px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

.queue-index {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: #e4eaf0;
  color: #4b5968;
  font-weight: 900;
}

.queue-main {
  min-width: 0;
  display: grid;
}

.queue-main span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primary-print-actions {
  margin-top: 12px;
  padding-top: 12px;
  display: grid;
  grid-template-columns: minmax(360px, 1fr);
  gap: 16px;
  align-items: end;
  border-top: 1px solid var(--line);
}

.primary-print-actions .print-options {
  padding: 0;
  grid-template-columns: repeat(3, minmax(140px, 220px));
  justify-content: start;
}

.primary-print-actions .print-btn {
  width: 100%;
  min-height: 52px;
  margin: 0;
}

.print-runtime-status {
  min-height: 54px;
  margin-top: 12px;
  padding: 9px 10px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  background: #f7f9fb;
}

.print-runtime-status > div {
  min-width: 0;
  display: grid;
}

.print-runtime-status strong {
  font-size: 11px;
}

.print-runtime-status div span {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.print-runtime-status[data-state="printing"] {
  border-color: #bdcbea;
  background: var(--blue-soft);
}

.print-runtime-status[data-state="printed"],
.print-runtime-status[data-state="connected"] {
  border-color: #a8d7ca;
  background: var(--brand-soft);
}

.print-runtime-status[data-state="error"] {
  border-color: #e6b0b0;
  background: var(--red-soft);
}

.preview-column {
  position: sticky;
  top: 88px;
}

.preview-panel {
  border: 1px solid var(--line);
  background: #fff;
}

.preview-head,
.panel-title,
.modal-head,
.drawer-head {
  min-height: 54px;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.label-stage {
  position: relative;
  min-height: 270px;
  padding: 42px 22px 26px 39px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background-color: #f5f7f9;
  background-image:
    linear-gradient(#e5eaef 1px, transparent 1px),
    linear-gradient(90deg, #e5eaef 1px, transparent 1px);
  background-size: 12px 12px;
}

.label-ruler {
  position: absolute;
  display: flex;
  color: #788493;
  font: 9px/1 var(--mono);
}

.ruler-x {
  left: 42px;
  right: 22px;
  top: 15px;
  justify-content: space-between;
}

.ruler-y {
  left: 13px;
  top: 46px;
  bottom: 28px;
  flex-direction: column;
  justify-content: space-between;
}

.tube-label {
  width: 326px;
  max-width: 100%;
  aspect-ratio: 50 / 18;
  padding: 8px;
  display: grid;
  grid-template-columns: 34% 66%;
  align-items: center;
  border: 1px solid #c4ccd5;
  background: #eef0ee;
  box-shadow: 0 5px 14px rgba(24, 33, 43, 0.12);
  transform-origin: center;
  transition: transform 0.2s ease;
}

.tube-label.rotated {
  transform: rotate(180deg);
}

.circle-sticker,
.strip-sticker {
  background: #fff;
  color: #111;
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

.circle-sticker {
  width: 80px;
  height: 80px;
  padding: 11px 8px;
  display: grid;
  place-items: center;
  align-content: center;
  justify-self: center;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px #e2e2e2;
  font-size: 7px;
  line-height: 1.2;
}

.circle-sticker strong {
  margin: 2px 0;
  font-size: 12px;
}

.strip-sticker {
  height: 88px;
  padding: 7px 8px;
  display: grid;
  grid-template-columns: 72px 1fr;
  grid-template-rows: 28px repeat(4, 1fr);
  column-gap: 8px;
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px #e2e2e2;
  font-size: 7px;
  line-height: 1.1;
  overflow: hidden;
}

.strip-sticker > .pdf417 {
  grid-row: 1 / 6;
  align-self: stretch;
}

.strip-sticker > strong {
  font-size: 12px;
}

.strip-sticker > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strip-sticker .library-value {
  font-weight: 800;
}

.pdf417 {
  display: block;
  min-width: 64px;
  min-height: 28px;
  border: 2px solid #111;
  background:
    repeating-linear-gradient(90deg, #111 0 2px, #fff 2px 4px, #111 4px 5px, #fff 5px 8px),
    repeating-linear-gradient(0deg, transparent 0 5px, #111 5px 7px, transparent 7px 11px);
  background-blend-mode: multiply;
}

.preview-info {
  min-height: 54px;
  padding: 9px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.preview-info > div {
  min-width: 0;
  display: grid;
}

.preview-info span {
  color: var(--muted);
  font-size: 10px;
}

.preview-info strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.print-options {
  padding: 12px 13px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

label {
  min-width: 0;
  display: grid;
  gap: 5px;
  color: #4b5866;
  font-size: 11px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  min-height: 37px;
  padding: 7px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  color: var(--text);
}

.stepper {
  height: 37px;
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  overflow: hidden;
}

.stepper button {
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  background: #f3f6f8;
  color: #394654;
}

.stepper button:first-child {
  border-right: 1px solid var(--line);
}

.stepper button:last-child {
  border-left: 1px solid var(--line);
}

.stepper input {
  min-height: 35px;
  padding: 0;
  border: 0;
  border-radius: 0;
  text-align: center;
  font-weight: 900;
}

.stepper svg {
  width: 14px;
}

.print-btn {
  margin: 0 13px 8px;
  width: calc(100% - 26px);
  min-height: 48px;
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #fff;
}

.print-btn:hover {
  background: #1949bd;
}

.print-btn span {
  flex: 1;
  text-align: left;
}

.print-btn kbd {
  padding: 3px 6px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 4px;
  font: 10px/1.3 var(--mono);
}

.preview-panel > .secondary-btn {
  margin: 0 13px 13px;
  width: calc(100% - 26px);
}

.page-intro {
  min-height: 74px;
  margin-bottom: 14px;
  padding: 3px 1px 12px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line-strong);
}

.page-intro h2 {
  font-size: 21px;
}

.page-intro p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.batch-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
  align-items: start;
}

.device-layout {
  display: grid;
  grid-template-columns: minmax(420px, 0.95fr) minmax(520px, 1.05fr);
  gap: 14px;
  align-items: start;
}

.batch-main,
.batch-summary,
.device-list,
.device-settings,
.jobs-panel {
  border: 1px solid var(--line);
  background: #fff;
}

.batch-toolbar {
  min-height: 64px;
  padding: 10px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.file-summary {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.file-summary > svg {
  width: 28px;
  height: 28px;
  color: var(--brand);
}

.file-summary div {
  min-width: 0;
  display: grid;
}

.file-summary strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-summary span {
  color: var(--muted);
  font-size: 11px;
}

.batch-summary {
  padding: 15px;
  display: grid;
  gap: 12px;
}

.batch-summary .print-btn {
  margin: 3px 0 0;
  width: 100%;
}

.summary-line {
  padding: 11px 0;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.summary-line span {
  color: var(--muted);
}

.template-editor {
  min-height: 690px;
  display: grid;
  grid-template-columns: 224px minmax(560px, 1fr) 304px;
  border: 1px solid var(--line);
  background: #fff;
}

.template-list,
.property-panel {
  min-width: 0;
  background: #fff;
}

.template-list {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-right: 1px solid var(--line);
}

.property-panel {
  max-height: 760px;
  overflow: auto;
  border-left: 1px solid var(--line);
}

.property-panel > .panel-title {
  position: sticky;
  top: 0;
  z-index: 7;
  background: #fff;
}

#templateList {
  min-height: 0;
  overflow: auto;
}

.template-family {
  width: calc(100% - 16px);
  margin: 8px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 6px;
}

.template-family.active {
  border-color: #a7d4ca;
  background: var(--brand-soft);
}

.template-family-card {
  width: 100%;
  min-height: 72px;
  padding: 8px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.template-family-card:hover {
  background: var(--panel-soft);
}

.template-family-card > span:nth-child(2) {
  min-width: 0;
  display: grid;
}

.template-family-card strong,
.template-family-card small,
.template-family-card em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-family-card small {
  margin-top: 2px;
  color: var(--muted);
}

.template-family-card em {
  margin-top: 4px;
  color: var(--brand);
  font-size: 11px;
  font-style: normal;
}

.template-family-card > svg {
  width: 15px;
  color: var(--brand);
}

.template-variants {
  display: grid;
  gap: 4px;
  padding: 0 8px 8px 64px;
}

.template-variant-btn {
  min-width: 0;
  min-height: 32px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--muted-strong);
  text-align: left;
}

.template-variant-btn span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-variant-btn small {
  color: var(--muted);
}

.template-variant-btn:hover,
.template-variant-btn.active {
  border-color: var(--brand);
  color: var(--brand);
}

.template-variant-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.template-variant-section-label small {
  color: var(--brand-dark);
  font-size: 8px;
}

.template-thumb {
  width: 48px;
  height: 34px;
  display: block;
  position: relative;
  overflow: hidden;
  border: 1px solid #acb6c1;
  background: #fff;
}

.template-thumb.tube {
  width: 20px;
  height: 54px;
  justify-self: center;
  border-color: #8f9aa7;
}

.template-thumb.rect {
  background:
    linear-gradient(#26313d, #26313d) 7px 7px / 24px 3px no-repeat,
    repeating-linear-gradient(90deg, #26313d 0 1px, transparent 1px 3px) 7px 15px / 31px 11px no-repeat,
    #fff;
}

.template-thumb-part {
  position: absolute;
  display: block;
  min-width: 1px;
  min-height: 1px;
  pointer-events: none;
}

.template-thumb-part.is-circle {
  z-index: 1;
  border: 1px dashed #9aa4af;
  border-radius: 50%;
}

.template-thumb-part.is-rectangle {
  z-index: 1;
  border: 1px solid #9aa4af;
}

.template-thumb-part.is-qrcode {
  z-index: 2;
  background:
    conic-gradient(from 90deg, #202b37 25%, #fff 0 50%, #202b37 0 75%, #fff 0) 0 0 / 3px 3px;
}

.template-thumb-part.is-pdf417 {
  z-index: 2;
  background:
    repeating-linear-gradient(0deg, #202b37 0 1px, #fff 1px 2px),
    repeating-linear-gradient(90deg, transparent 0 2px, #202b37 2px 3px);
}

.template-thumb-part.is-text {
  z-index: 2;
  background: #36414d;
  opacity: 0.8;
}

.template-list-note {
  min-height: 49px;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--line);
  background: #f8fafb;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.template-list-note svg {
  width: 15px;
  flex: 0 0 auto;
  color: var(--brand);
}

#templateSyncStatus[data-state="error"] {
  color: var(--red);
}

#templateSyncStatus[data-state="cache"],
#templateSyncStatus[data-state="saving"] {
  color: #976012;
}

.design-workspace {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: #e8edf1;
}

.design-toolbar {
  min-height: 52px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.tool-group,
.zoom-control {
  display: flex;
  align-items: center;
  gap: 5px;
}

.view-orientation-control {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f5f7f8;
}

.view-orientation-control .tool-btn {
  width: auto;
  min-width: 68px;
  padding: 0 9px;
  gap: 6px;
  border-color: transparent;
  background: transparent;
}

.view-orientation-control .tool-btn span {
  font-size: 11px;
  font-weight: 800;
}

.view-orientation-control .tool-btn.active {
  border-color: #a9cfc8;
  background: #fff;
  box-shadow: 0 1px 2px rgba(24, 33, 43, 0.08);
}

.tool-btn {
  width: 32px;
  height: 32px;
}

.tool-btn.active {
  border-color: #9dc9c0;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.zoom-control span {
  min-width: 58px;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
}

.design-stage {
  position: relative;
  min-height: 0;
  overflow: auto;
  background-color: #f1f3f5;
  background-image:
    linear-gradient(#dfe5ea 1px, transparent 1px),
    linear-gradient(90deg, #dfe5ea 1px, transparent 1px);
  background-size: 10px 10px;
}

.design-stage-center {
  position: relative;
  min-width: 100%;
  min-height: 100%;
  padding: 38px;
  display: grid;
  place-items: center;
}

@media (min-width: 921px) {
  #page-templates.active {
    min-height: calc(100dvh - 74px);
    display: flex;
    flex-direction: column;
  }

  #page-templates .page-intro {
    flex: 0 0 auto;
  }

  #page-templates .template-editor {
    min-height: 620px;
    flex: 1 1 auto;
  }
}

.design-ruler {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  background: #fff;
  border: 1px solid var(--line);
  color: #73808e;
  font: 8px/1 var(--mono);
}

.design-ruler.top {
  top: 7px;
  height: 20px;
}

.design-ruler.left {
  left: 7px;
  width: 20px;
}

.design-ruler span {
  position: absolute;
}

.design-ruler.top span {
  top: 5px;
  transform: translateX(-50%);
}

.design-ruler.left span {
  left: 4px;
  transform: translateY(-50%);
}

.design-label {
  position: absolute;
  left: 0;
  top: 0;
  flex: 0 0 auto;
  outline: 2px solid #2d3742;
  outline-offset: 0;
  background: #fff;
  box-shadow: 0 9px 24px rgba(24, 33, 43, 0.15);
  overflow: visible;
  touch-action: none;
  transform-origin: 0 0;
}

.design-label-viewport {
  position: relative;
  flex: 0 0 auto;
  overflow: visible;
  touch-action: none;
}

.design-object {
  position: absolute;
  z-index: 1;
  min-width: 2px;
  min-height: 2px;
  padding: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  border: 1px dashed transparent;
  border-radius: 2px;
  background: transparent;
  color: #111827;
  line-height: 1.05;
  letter-spacing: 0;
  white-space: nowrap;
  cursor: move;
  touch-action: none;
  user-select: none;
  appearance: none;
}

.design-object-text {
  overflow: hidden;
  white-space: normal;
}

.design-text-content {
  display: block;
  width: 100%;
  white-space: pre;
}

.design-object:hover {
  border-color: #7a9ad0;
  background: rgba(237, 243, 255, 0.42);
}

.design-object.selected {
  z-index: 2;
  border-color: var(--blue);
  background: rgba(237, 243, 255, 0.5);
  box-shadow: 0 0 0 1px #fff, 0 0 0 2px var(--blue);
}

.design-object.locked {
  cursor: default;
}

.design-object.locked:hover {
  border-color: transparent;
  background: transparent;
}

.design-object-circle.locked:hover,
.design-object-rectangle.locked:hover {
  border-color: #111827;
  background: rgba(255, 255, 255, 0.01);
}

.design-object.not-printable {
  opacity: 0.46;
}

.design-object.outside-region {
  border-color: #d64545;
  background: rgba(214, 69, 69, 0.08);
  box-shadow: 0 0 0 1px rgba(214, 69, 69, 0.28);
}

.design-object.outside-canvas:not(.outside-region) {
  border-color: #b96b16;
  background: rgba(185, 107, 22, 0.08);
  box-shadow: 0 0 0 1px rgba(185, 107, 22, 0.24);
}

.design-object-text {
  overflow: hidden;
}

.design-text-content {
  display: block;
  width: 100%;
  white-space: pre;
}

.font-calibration-hint {
  margin-top: -5px;
  color: var(--brand-dark);
  font: 9px/1.4 var(--mono);
}

.design-object-pdf417,
.design-object-code128,
.design-object-qrcode {
  overflow: hidden;
  background: #fff;
}

.design-object-circle,
.design-object-rectangle {
  border: var(--shape-stroke, 1px) solid #111827;
  background: rgba(255, 255, 255, 0.01);
}

.design-object-circle {
  border-radius: 50%;
}

.design-object-circle:hover,
.design-object-rectangle:hover {
  border-color: #111827;
  background: rgba(237, 243, 255, 0.18);
}

.design-object-circle.selected,
.design-object-rectangle.selected {
  border-color: #111827;
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  background: rgba(237, 243, 255, 0.18);
}

.design-object-circle.not-printable,
.design-object-rectangle.not-printable {
  border-style: dashed;
  opacity: 0.58;
}

.shape-measure {
  position: absolute;
  left: 50%;
  bottom: -23px;
  min-width: max-content;
  padding: 3px 5px;
  border: 1px solid #b8c3cd;
  border-radius: 3px;
  background: #fff;
  color: #4e5c69;
  font: 9px/1 var(--mono);
  transform: translateX(-50%);
  pointer-events: none;
}

.design-barcode-canvas {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: fill;
  pointer-events: none;
}

.design-resize-handle {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 9px;
  height: 9px;
  border: 1px solid #fff;
  border-radius: 1px;
  background: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
  cursor: nwse-resize;
}

.design-status {
  min-height: 34px;
  padding: 0 11px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 15px;
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 10px;
}

.design-status span,
.status-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.design-status svg,
.status-toggle svg {
  width: 13px;
}

.design-overflow-status {
  color: #bd3434;
  font-weight: 850;
}

.design-overflow-status.ok {
  color: #24836a;
}

.design-overflow-status.allowed {
  color: #9a5c13;
}

.design-overflow-status:empty {
  display: none;
}

.status-toggle {
  min-height: 26px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.status-toggle.active {
  border-color: #9dc9c0;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.wysiwyg-badge {
  color: var(--brand-dark);
  font-weight: 850;
}

.property-empty {
  min-height: 210px;
  padding: 28px 18px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}

.property-empty svg {
  width: 32px;
  height: 32px;
  color: #8794a2;
}

.property-empty span {
  font-size: 11px;
}

.page-property {
  padding: 13px;
  display: grid;
  gap: 11px;
  border-bottom: 1px solid var(--line);
}

.global-calibration-panel {
  position: sticky;
  top: 54px;
  z-index: 6;
  padding: 12px 13px;
  display: grid;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: #f8fbfa;
  box-shadow: 0 3px 8px rgba(24, 33, 43, 0.05);
}

.template-layer-panel {
  padding: 11px 13px;
  display: grid;
  gap: 7px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.template-layer-segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

.template-layer-segmented button {
  min-height: 30px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted-strong);
  font-size: 10px;
  font-weight: 850;
}

.template-layer-segmented button.active {
  border-color: #a7d4ca;
  background: #fff;
  color: var(--brand-dark);
  box-shadow: 0 1px 2px rgba(24, 33, 43, 0.08);
}

.template-layer-panel > small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.global-calibration-head {
  min-height: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.global-calibration-head > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--brand-dark);
  font-weight: 850;
}

.global-calibration-head svg {
  width: 15px;
}

.global-calibration-head > small {
  color: var(--muted);
  font: 9px/1 var(--mono);
}

.global-calibration-panel label > span {
  display: flex;
  justify-content: space-between;
  gap: 5px;
}

.global-calibration-panel label > span small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
}

.calibration-nudge {
  display: grid;
  grid-template-columns: repeat(5, 34px);
  justify-content: center;
  gap: 5px;
}

.calibration-nudge .icon-btn {
  width: 34px;
  height: 32px;
  border-color: #bdcbd0;
  background: #fff;
}

.calibration-nudge .icon-btn:hover {
  border-color: #88bcb2;
  color: var(--brand-dark);
}

.template-editor[data-view-orientation="portrait"] .calibration-nudge {
  grid-template-columns: repeat(3, 34px);
  grid-template-rows: repeat(3, 32px);
}

.template-editor[data-view-orientation="portrait"] .calibration-nudge .nudge-up {
  grid-column: 2;
  grid-row: 1;
}

.template-editor[data-view-orientation="portrait"] .calibration-nudge .nudge-left {
  grid-column: 1;
  grid-row: 2;
}

.template-editor[data-view-orientation="portrait"] .calibration-nudge .nudge-reset {
  grid-column: 2;
  grid-row: 2;
}

.template-editor[data-view-orientation="portrait"] .calibration-nudge .nudge-right {
  grid-column: 3;
  grid-row: 2;
}

.template-editor[data-view-orientation="portrait"] .calibration-nudge .nudge-down {
  grid-column: 2;
  grid-row: 3;
}

.page-property-head {
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.page-property-head span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 850;
}

.page-property-head svg {
  width: 15px;
  color: var(--brand);
}

.page-property-head small {
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f7f9fa;
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
}

.size-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.size-presets button {
  min-height: 30px;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  font-size: 10px;
  font-weight: 800;
}

.size-presets button.active {
  border-color: #9dc9c0;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.property-form {
  padding: 13px;
  display: grid;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.property-form label {
  min-width: 0;
}

.property-subgroup {
  display: grid;
  gap: 10px;
}

.property-subgroup small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.rotation-property {
  padding-top: 2px;
}

.property-option-label {
  color: var(--ink);
  font-size: 10px;
  font-weight: 850;
}

.qr-size-property {
  padding: 9px;
  border: 1px solid #b8d9d1;
  border-radius: 5px;
  background: #f5fbf9;
}

.qr-size-segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.qr-size-segmented button {
  min-width: 0;
  min-height: 44px;
  padding: 5px 3px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--muted);
  display: grid;
  place-content: center;
  gap: 1px;
}

.qr-size-segmented button strong {
  color: inherit;
  font-size: 10px;
  line-height: 1.2;
}

.qr-size-segmented button small {
  color: inherit;
  font-size: 8px;
  line-height: 1.2;
}

.qr-size-segmented button:hover:not(:disabled) {
  border-color: #8ebdb4;
  color: var(--brand-dark);
}

.qr-size-segmented button.active {
  border-color: #48a18f;
  background: var(--brand-soft);
  color: var(--brand-dark);
  box-shadow: inset 0 0 0 1px rgba(14, 125, 106, 0.12);
}

.qr-size-segmented button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.rotation-segmented {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.rotation-segmented button {
  min-width: 0;
  min-height: 34px;
  padding: 0 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.rotation-segmented button:hover:not(:disabled) {
  border-color: #8ebdb4;
  color: var(--brand-dark);
}

.rotation-segmented button.active {
  border-color: #78b1a6;
  background: var(--brand-soft);
  color: var(--brand-dark);
  box-shadow: inset 0 0 0 1px rgba(14, 125, 106, 0.08);
}

.rotation-segmented button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.calibration-note {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.property-type-row {
  min-height: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.property-type-row span {
  padding: 3px 7px;
  border: 1px solid #a8d7ca;
  border-radius: 4px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 10px;
  font-weight: 850;
}

.property-type-row small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font: 9px/1 var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.switch-row {
  min-height: 38px;
  padding: 7px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.switch-row input {
  width: 36px;
  min-height: 20px;
  accent-color: var(--brand);
}

.layer-panel {
  min-height: 180px;
}

.layer-panel-head {
  min-height: 39px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: #f8fafb;
  font-size: 11px;
}

.layer-panel-head span {
  color: var(--muted);
  font: 10px/1 var(--mono);
}

.layer-list {
  display: grid;
}

.layer-row {
  min-width: 0;
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.layer-row.active {
  box-shadow: inset 3px 0 0 var(--blue);
  background: var(--blue-soft);
}

.layer-select {
  min-width: 0;
  height: 41px;
  padding: 6px 9px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.layer-select span {
  color: var(--muted);
  font-size: 9px;
}

.layer-select strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-actions {
  padding-right: 5px;
  display: flex;
  align-items: center;
  gap: 2px;
}

.icon-btn.tiny {
  width: 24px;
  height: 24px;
  border-color: transparent;
  background: transparent;
}

.icon-btn.tiny svg {
  width: 13px;
}

.device-list {
  display: grid;
}

.device-row {
  min-height: 82px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: auto minmax(150px, 1fr) auto auto;
  grid-template-areas:
    "icon name state action"
    "icon capabilities media media";
  column-gap: 10px;
  row-gap: 5px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.device-row > .device-icon {
  grid-area: icon;
}

.device-row > .device-name {
  grid-area: name;
}

.device-row > .device-capabilities {
  grid-area: capabilities;
}

.device-row > .device-media {
  grid-area: media;
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 7px;
}

.device-row > .state-badge {
  grid-area: state;
}

.device-row > button:last-child {
  grid-area: action;
}

.device-row:last-child {
  border-bottom: 0;
}

.device-row.active {
  box-shadow: inset 3px 0 0 var(--brand);
  background: #fbfefd;
}

.device-icon {
  position: relative;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f3f6f8;
  color: #43515f;
}

.device-icon .status-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
}

.device-name,
.device-media {
  min-width: 0;
  display: grid;
}

.device-name span,
.device-media span {
  color: var(--muted);
  font-size: 11px;
}

.device-capabilities {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.device-capabilities span {
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f5f7f9;
  color: #4e5b68;
  font-size: 9px;
  font-weight: 850;
}

.device-row.fixed-device {
  box-shadow: inset 3px 0 0 var(--brand);
}

.device-row.fixed-device .device-name::after {
  content: "本机固定";
  width: max-content;
  margin-top: 3px;
  padding: 2px 5px;
  border: 1px solid #a8d7ca;
  border-radius: 3px;
  background: var(--brand-soft);
  color: #0f6f58;
  font-size: 8px;
  font-weight: 850;
}

.device-settings {
  position: sticky;
  top: 88px;
}

.fixed-station-card {
  min-height: 66px;
  margin: 13px;
  padding: 10px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  background: #f7f9fb;
}

.fixed-station-card > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.fixed-station-card strong {
  font-size: 11px;
}

.fixed-station-card span:not(.status-dot) {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.fixed-station-card .secondary-btn {
  min-height: 34px;
  padding: 0 10px;
  white-space: nowrap;
  font-size: 10px;
}

.fixed-station-card[data-state="waiting"] {
  border-color: #bdcbea;
  background: var(--blue-soft);
}

.fixed-station-card[data-state="waiting"] .status-dot {
  background: #3973d3;
  box-shadow: 0 0 0 3px rgba(57, 115, 211, 0.13);
}

.fixed-station-card[data-state="ready"] {
  border-color: #a8d7ca;
  background: var(--brand-soft);
}

.fixed-station-card[data-state="ready"] .status-dot {
  background: #15966f;
  box-shadow: 0 0 0 3px rgba(21, 150, 111, 0.13);
}

.fixed-station-card[data-state="authorization"] {
  border-color: #d8ba7d;
  background: #fffaf0;
}

.fixed-station-card[data-state="authorization"] .status-dot {
  background: #c78a2b;
  box-shadow: 0 0 0 3px rgba(199, 138, 43, 0.13);
}

.settings-group {
  padding: 13px;
  border-bottom: 1px solid var(--line);
}

.settings-group h3 {
  margin-bottom: 10px;
}

.device-command-grid {
  padding: 13px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.physical-calibration-guide {
  margin: 0 13px 13px;
  border: 1px solid #d8ba7d;
  background: #fffaf0;
}

.physical-calibration-heading {
  padding: 11px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid #ead9b5;
}

.physical-calibration-heading > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.physical-calibration-heading strong {
  font-size: 12px;
}

.physical-calibration-steps {
  margin: 0;
  padding: 10px 12px;
  display: grid;
  gap: 8px;
  list-style: none;
}

.physical-calibration-steps li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.physical-calibration-steps li > span {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid #c79c4f;
  color: #815d1f;
  font-size: 10px;
  font-weight: 850;
}

.physical-calibration-steps p {
  margin: 2px 0 0;
  color: #4e4b43;
  font-size: 10px;
  line-height: 1.45;
}

.physical-calibration-note {
  margin: 0 12px 10px;
  padding: 9px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 7px;
  align-items: start;
  border: 1px solid #ead9b5;
  background: #fff;
  color: #6a5735;
  font-size: 9px;
  line-height: 1.45;
}

.physical-calibration-note svg {
  width: 16px;
  height: 16px;
}

.physical-calibration-actions {
  padding: 0 12px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.physical-calibration-actions .primary-btn,
.physical-calibration-actions .secondary-btn {
  min-height: 36px;
  justify-content: center;
  font-size: 10px;
}

.device-action-status,
.font-install-status {
  min-height: 62px;
  margin: 0 13px 13px;
  padding: 9px 10px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  background: #f7f9fb;
}

.device-action-status > div,
.font-install-status > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.device-action-status strong,
.font-install-status strong {
  font-size: 11px;
}

.device-action-status span:not(.status-dot),
.font-install-status span:not(.status-dot) {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.device-action-status[data-state="working"],
.font-install-status[data-state="working"] {
  border-color: #bdcbea;
  background: var(--blue-soft);
}

.device-action-status[data-state="working"] .status-dot,
.font-install-status[data-state="working"] .status-dot {
  background: #3973d3;
  box-shadow: 0 0 0 3px rgba(57, 115, 211, 0.13);
}

.device-action-status[data-state="success"],
.font-install-status[data-state="success"] {
  border-color: #a8d7ca;
  background: var(--brand-soft);
}

.device-action-status[data-state="success"] .status-dot,
.font-install-status[data-state="success"] .status-dot {
  background: #15966f;
  box-shadow: 0 0 0 3px rgba(21, 150, 111, 0.13);
}

.device-action-status[data-state="error"],
.font-install-status[data-state="error"] {
  border-color: #e6b0b0;
  background: var(--red-soft);
}

.device-action-status[data-state="error"] .status-dot,
.font-install-status[data-state="error"] .status-dot {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(196, 55, 55, 0.13);
}

.jobs-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
}

.jobs-metrics > div {
  min-height: 88px;
  padding: 16px;
  display: grid;
  border-right: 1px solid var(--line);
}

.jobs-metrics > div:last-child {
  border-right: 0;
}

.jobs-metrics span {
  color: var(--muted);
  font-size: 11px;
}

.jobs-metrics strong {
  margin-top: 4px;
  font-size: 27px;
}

.red {
  color: var(--red);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  padding: 20px;
  display: grid;
  place-items: center;
  background: rgba(24, 33, 43, 0.42);
}

.modal {
  width: min(520px, 100%);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(24, 33, 43, 0.25);
}

.box-label-modal {
  width: min(720px, 100%);
  max-height: calc(100vh - 40px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.box-label-body {
  min-height: 0;
  padding: 16px;
  display: grid;
  gap: 14px;
  overflow: auto;
}

.box-label-selection {
  min-height: 70px;
  padding: 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid #9bcfc2;
  border-radius: 6px;
  background: var(--brand-soft);
}

.box-label-selection-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #fff;
  color: var(--brand-dark);
}

.box-label-selection-icon svg {
  width: 21px;
}

.box-label-selection > div:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.box-label-selection span,
.box-label-selection small {
  color: var(--muted);
  font-size: 11px;
}

.box-label-selection strong {
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.box-label-form-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 1.2fr;
  gap: 10px;
}

.box-label-form-grid label {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.box-label-form-grid label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.box-label-form-grid input,
.box-label-form-grid select {
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.box-label-lifecycle {
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

.box-label-lifecycle > div {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 8px;
}

.box-label-lifecycle > div > span {
  grid-row: 1 / 3;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid #91cabb;
  border-radius: 50%;
  background: #fff;
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 900;
}

.box-label-lifecycle strong {
  font-size: 12px;
}

.box-label-lifecycle small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

.box-label-lifecycle > svg {
  width: 16px;
  color: var(--muted);
}

.box-label-batch {
  padding: 12px;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  background: #fff;
}

.box-label-batch > div:first-child {
  display: grid;
  gap: 2px;
}

.box-label-batch > div:first-child span {
  color: var(--muted);
  font-size: 11px;
}

.box-label-batch-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 6px;
}

.box-label-batch-item {
  min-height: 45px;
  padding: 7px 9px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel-soft);
}

.box-label-batch-item > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.box-label-batch-item strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.box-label-batch-item small {
  color: var(--muted);
  font-size: 9px;
}

.box-label-footer {
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  border-top: 1px solid var(--line);
  background: #fff;
}

.box-label-footer p {
  min-width: 0;
  margin: 0;
  display: flex;
  gap: 7px;
  align-items: flex-start;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.box-label-footer p svg {
  width: 16px;
  flex: 0 0 auto;
  color: var(--brand);
}

.box-label-footer > div {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
}

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

  .box-label-form-grid label:last-child {
    grid-column: 1 / -1;
  }

  .box-label-lifecycle {
    grid-template-columns: 1fr;
  }

  .box-label-lifecycle > svg {
    display: none;
  }

  .box-label-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .box-label-footer > div > button {
    flex: 1;
  }
}

.operator-guide-modal {
  width: min(760px, 100%);
  max-height: calc(100vh - 40px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.operator-guide-body {
  min-height: 0;
  padding: 16px;
  overflow: auto;
}

.operator-guide-status {
  min-height: 64px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
}

.operator-guide-status[data-state="ready"] {
  border-color: #9bcfc2;
  background: var(--brand-soft);
}

.operator-guide-status[data-state="waiting"] {
  border-color: #e0c18e;
  background: var(--orange-soft);
}

.operator-guide-status > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.operator-guide-status strong {
  font-size: 12px;
}

.operator-guide-status div span {
  color: var(--muted);
  font-size: 10px;
}

.operator-guide-status .secondary-btn {
  min-height: 36px;
}

.operator-guide-steps {
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  list-style: none;
}

.operator-guide-steps li {
  position: relative;
  min-height: 96px;
  padding: 14px 12px 12px 48px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.operator-guide-steps li > svg {
  width: 22px;
  height: 22px;
  color: var(--brand);
}

.operator-guide-steps li > div {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.operator-guide-steps strong {
  font-size: 12px;
}

.operator-guide-steps div span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.operator-guide-number {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid #9bcfc2;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font: 750 11px/1 var(--font);
}

.operator-guide-tip {
  min-height: 44px;
  margin-top: 10px;
  padding: 9px 11px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  border: 1px solid #d8dee5;
  background: #f7f9fb;
  color: #4d5a68;
  font-size: 10px;
}

.operator-guide-tip svg {
  width: 18px;
  height: 18px;
  color: #95611d;
}

.operator-guide-footer {
  min-height: 64px;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--line);
  background: #fbfcfd;
}

.operator-guide-footer .check-control {
  flex: 0 1 auto;
}

.operator-guide-footer .inline-actions {
  flex: 0 0 auto;
}

.windows-usb-modal {
  width: min(820px, 100%);
  max-height: calc(100vh - 40px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.windows-usb-body {
  min-height: 0;
  padding: 16px;
  overflow: auto;
}

.windows-usb-status {
  min-height: 64px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
}

.windows-usb-status[data-state="working"] {
  border-color: #bdcbea;
  background: var(--blue-soft);
}

.windows-usb-status[data-state="working"] .status-dot {
  background: #3973d3;
}

.windows-usb-status[data-state="ready"] {
  border-color: #9bcfc2;
  background: var(--brand-soft);
}

.windows-usb-status[data-state="ready"] .status-dot {
  background: #15966f;
  box-shadow: 0 0 0 3px rgba(21, 150, 111, 0.13);
}

.windows-usb-status[data-state="error"] {
  border-color: #e6b0b0;
  background: var(--red-soft);
}

.windows-usb-status[data-state="error"] .status-dot {
  background: var(--red);
}

.windows-usb-status > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.windows-usb-status strong {
  font-size: 12px;
}

.windows-usb-status div span {
  color: var(--muted);
  font-size: 10px;
}

.windows-usb-requirements {
  margin-top: 10px;
  padding: 9px 11px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  border: 1px solid #c9d6e3;
  background: #f7fafc;
  color: #40505f;
}

.windows-usb-requirements svg {
  width: 18px;
  height: 18px;
  color: var(--blue);
}

.windows-usb-requirements div {
  display: grid;
  gap: 2px;
}

.windows-usb-requirements strong {
  font-size: 11px;
}

.windows-usb-requirements span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.windows-usb-steps {
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 9px;
  list-style: none;
}

.windows-usb-steps li {
  min-height: 78px;
  padding: 11px 12px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  border: 1px solid var(--line);
  background: #fff;
}

.windows-usb-steps li > span:first-child {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid #9bcfc2;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11px;
  font-weight: 850;
}

.windows-usb-steps li > div:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.windows-usb-steps strong {
  font-size: 12px;
}

.windows-usb-steps p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.windows-usb-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.windows-usb-links a {
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
}

.windows-usb-links .secondary-btn {
  min-height: 30px;
  padding: 6px 9px;
  white-space: normal;
}

.windows-usb-file {
  padding: 7px 9px;
  border: 1px solid var(--line);
  background: #f4f6f8;
  color: #43515f;
  font: 700 9px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: nowrap;
}

.windows-usb-note {
  min-height: 46px;
  margin-top: 10px;
  padding: 9px 11px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  border: 1px solid #d8dee5;
  background: #f7f9fb;
  color: #4d5a68;
  font-size: 10px;
  line-height: 1.45;
}

.windows-usb-note svg {
  width: 18px;
  height: 18px;
  color: var(--brand);
}

.catalog-modal {
  width: min(1440px, calc(100vw - 24px));
  height: min(900px, calc(100vh - 24px));
  max-height: calc(100vh - 24px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.catalog-modal-head {
  min-height: 70px;
}

.catalog-modal-actions,
.catalog-source-compact {
  display: flex;
  align-items: center;
}

.catalog-modal-actions {
  gap: 8px;
}

.catalog-source-compact {
  min-width: 260px;
  gap: 8px;
  padding-right: 14px;
  border-right: 1px solid var(--line);
}

.catalog-source-compact > div {
  min-width: 0;
  display: grid;
}

.catalog-source-compact strong,
.catalog-source-compact span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-source-compact strong {
  font-size: 11px;
}

.catalog-source-compact span {
  color: var(--muted);
  font-size: 9px;
}

.catalog-manager-body {
  min-height: 0;
  display: grid;
  grid-template-columns: 210px minmax(520px, 1fr) 410px;
  overflow: hidden;
  border-top: 1px solid var(--line);
}

.catalog-manager-sidebar {
  min-width: 0;
  padding: 14px 10px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 20px;
  border-right: 1px solid var(--line);
  background: #f6f8fa;
}

.catalog-manager-sidebar section {
  display: grid;
  gap: 7px;
}

.catalog-manager-sidebar h3 {
  margin: 0 9px;
  color: #75808d;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0;
}

.catalog-nav-list {
  display: grid;
  gap: 3px;
}

.catalog-nav-list button {
  width: 100%;
  min-height: 38px;
  padding: 0 9px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #3f4c5a;
  text-align: left;
}

.catalog-nav-list button:hover {
  border-color: #d4dde4;
  background: #fff;
}

.catalog-nav-list button.active {
  border-color: #a8d7ca;
  background: #e8f5f1;
  color: var(--brand-dark);
}

.catalog-nav-list button svg {
  width: 17px;
  height: 17px;
}

.catalog-nav-list button span {
  overflow: hidden;
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-nav-list button b {
  min-width: 24px;
  padding: 3px 5px;
  border: 1px solid #d7dfe6;
  border-radius: 9px;
  background: #fff;
  color: #6e7a87;
  font-size: 9px;
  text-align: center;
}

.catalog-nav-list button.active b {
  border-color: #b5ddd3;
  color: var(--brand-dark);
}

.catalog-sidebar-note {
  align-self: end;
  padding: 10px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.catalog-sidebar-note svg {
  width: 17px;
  height: 17px;
  color: var(--brand);
}

.catalog-directory-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  background: #fff;
}

.catalog-manager-toolbar {
  min-height: 64px;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.catalog-manager-toolbar > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.catalog-manager-toolbar > div span {
  color: var(--muted);
  font-size: 10px;
}

.label-filter {
  width: min(300px, 48%);
  min-height: 36px;
  padding: 0 9px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
}

.label-filter svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.label-filter input {
  min-width: 0;
  min-height: 32px;
  padding: 0;
  border: 0;
  outline: 0;
}

.catalog-table-head,
.catalog-manager-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.6fr) 96px 104px 112px minmax(120px, 1fr) 72px;
  gap: 8px;
  align-items: center;
}

.catalog-table-head {
  min-height: 34px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: #f7f9fb;
  color: #7a8591;
  font-size: 9px;
  font-weight: 850;
}

.catalog-manager-list {
  min-height: 0;
  overflow: auto;
  background: #fff;
}

.catalog-empty {
  min-height: 220px;
  padding: 32px;
  display: grid;
  place-content: center;
  gap: 7px;
  color: var(--muted);
  text-align: center;
}

.catalog-empty svg {
  width: 28px;
  height: 28px;
  margin: 0 auto;
}

.catalog-group {
  border-bottom: 1px solid var(--line);
}

.catalog-group-head {
  min-height: 32px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #f7f9fb;
  color: #45515e;
  font-size: 10px;
}

.catalog-group-head strong {
  font-weight: 900;
}

.catalog-group-head span {
  color: #8a949f;
  font-size: 9px;
}

.catalog-manager-row {
  position: relative;
  min-height: 50px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
}

.catalog-group .catalog-manager-row:last-child {
  border-bottom: 0;
}

.catalog-manager-row:hover {
  background: #f8fafb;
}

.catalog-row-main,
.catalog-row-cell {
  min-width: 0;
  display: grid;
}

.catalog-row-main strong,
.catalog-row-main span,
.catalog-row-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-row-main strong {
  color: #25313d;
  font-size: 11px;
}

.catalog-row-main span,
.catalog-row-cell {
  color: #65717e;
  font-size: 9px;
}

.catalog-row-code {
  display: grid;
  gap: 2px;
  color: #172431;
  font: 800 10px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.catalog-row-code small {
  color: var(--brand-dark);
  font: 850 8px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.catalog-row-code .catalog-cap-code-warning {
  width: max-content;
  padding: 2px 4px;
  border: 1px solid #e2bd78;
  border-radius: 4px;
  background: #fff8e8;
  color: #98611d;
  font-family: inherit;
}

.catalog-placement-label,
.catalog-purpose-label {
  width: max-content;
  max-width: 100%;
  min-height: 24px;
  padding: 3px 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d4dde4;
  border-radius: 5px;
  background: #f8fafb;
  color: #53606c;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.catalog-purpose-label {
  border-color: #b8ddd5;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.catalog-row-actions {
  position: relative;
  display: flex;
  gap: 2px;
  align-items: center;
  justify-self: end;
}

.catalog-row-actions .icon-btn {
  width: 30px;
  height: 30px;
}

.catalog-copy-btn {
  color: var(--brand-dark);
}

.catalog-readonly {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: #a0a8b1;
}

.catalog-readonly svg {
  width: 15px;
  height: 15px;
}

.catalog-row-menu {
  position: absolute;
  top: 30px;
  right: 0;
  z-index: 5;
  width: 126px;
  padding: 4px;
  display: grid;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(22, 32, 43, 0.14);
}

.catalog-row-menu button {
  min-height: 32px;
  padding: 0 8px;
  display: flex;
  gap: 7px;
  align-items: center;
  border: 0;
  background: transparent;
  color: var(--red);
  font-size: 10px;
  font-weight: 800;
  text-align: left;
}

.catalog-row-menu button:hover {
  background: var(--red-soft);
}

.catalog-row-menu svg {
  width: 15px;
  height: 15px;
}

.catalog-create-panel {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  border-left: 1px solid var(--line);
  background: #fff;
}

.catalog-create-head {
  min-height: 64px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.catalog-create-head h3 {
  margin: 2px 0 0;
  font-size: 14px;
}

.catalog-create-head small {
  margin-top: 3px;
  display: block;
  color: var(--muted);
  font-size: 8px;
}

.catalog-add-form {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.catalog-add-form label {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.catalog-add-form label > span,
.catalog-placement-picker legend {
  color: #596572;
  font-size: 10px;
  font-weight: 850;
}

.catalog-add-form label > span b {
  color: var(--brand-dark);
  font-size: 8px;
}

.catalog-add-form input,
.catalog-add-form select {
  width: 100%;
  min-height: 40px;
}

.catalog-placement-picker {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.catalog-placement-picker legend {
  margin-bottom: 6px;
}

.catalog-placement-picker > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.catalog-placement-picker button {
  min-width: 0;
  min-height: 64px;
  padding: 7px 5px;
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr);
  gap: 6px;
  align-items: start;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  color: #3d4955;
  text-align: left;
}

.catalog-placement-picker button:hover,
.catalog-placement-picker button.active {
  border-color: #87c6b6;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.catalog-placement-picker svg {
  width: 18px;
  height: 18px;
}

.catalog-placement-picker span {
  min-width: 0;
  display: grid;
  gap: 2px;
  font-size: 10px;
  font-weight: 850;
}

.catalog-placement-picker small {
  color: #7a8590;
  font-size: 8px;
  font-weight: 650;
}

.catalog-placement-preview {
  min-height: 92px;
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) auto minmax(0, 1.25fr);
  gap: 9px;
  align-items: center;
  border: 1px solid #d7dfe6;
  background-color: #f8fafb;
  background-image: linear-gradient(#eef2f5 1px, transparent 1px), linear-gradient(90deg, #eef2f5 1px, transparent 1px);
  background-size: 10px 10px;
}

.catalog-placement-preview > div {
  min-width: 0;
  display: grid;
  place-items: center;
  gap: 5px;
}

.catalog-placement-preview > svg {
  width: 16px;
  height: 16px;
  color: #97a2ad;
}

.catalog-placement-preview small {
  color: #76818d;
  font-size: 8px;
}

.catalog-cap-preview {
  width: 56px;
  aspect-ratio: 1;
  padding: 5px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #2c3742;
  border-radius: 50%;
  background: #fff;
  color: #18232e;
  font: 850 8px/1.15 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-align: center;
  overflow-wrap: anywhere;
}

.catalog-cap-preview[data-density="tight"] {
  font-size: 7px;
}

.catalog-wall-preview {
  width: 112px;
  aspect-ratio: 2.6 / 1;
  padding: 7px;
  display: grid;
  align-content: center;
  overflow: hidden;
  border: 1px solid #2c3742;
  border-radius: 4px;
  background: #fff;
}

.catalog-wall-preview b,
.catalog-wall-preview em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-wall-preview b {
  font-size: 8px;
}

.catalog-wall-preview em {
  margin-top: 3px;
  color: #4d5a67;
  font: 700 7px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-style: normal;
}

.catalog-add-form[data-placement="cap"] .catalog-placement-preview > svg,
.catalog-add-form[data-placement="cap"] .catalog-placement-preview > div:last-child,
.catalog-add-form[data-placement="wall"] .catalog-placement-preview > div:first-child,
.catalog-add-form[data-placement="wall"] .catalog-placement-preview > svg {
  display: none;
}

.catalog-add-form[data-placement="cap"] .catalog-placement-preview,
.catalog-add-form[data-placement="wall"] .catalog-placement-preview {
  grid-template-columns: 1fr;
}

.catalog-code-field > div {
  position: relative;
}

.catalog-code-field input {
  padding-right: 54px;
  font: 800 12px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: uppercase;
}

.catalog-code-field small {
  position: absolute;
  top: 50%;
  right: 10px;
  color: #7f8994;
  font-size: 8px;
  transform: translateY(-50%);
}

.catalog-code-field small[data-state="limit"] {
  color: #a3671e;
  font-weight: 850;
}

.catalog-auto-code {
  min-height: 58px;
  padding: 9px 10px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  border: 1px solid #d4dde4;
  background: #f7f9fb;
}

.catalog-auto-code > svg {
  width: 18px;
  height: 18px;
  color: var(--brand);
}

.catalog-auto-code > div {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 8px;
  align-items: center;
}

.catalog-auto-code span {
  color: #4f5c68;
  font-size: 9px;
  font-weight: 850;
}

.catalog-auto-code strong {
  color: var(--brand-dark);
  font: 900 13px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.catalog-auto-code small {
  grid-column: 1 / -1;
  color: #6d7883;
  font-size: 8px;
  line-height: 1.45;
}

.catalog-code-rules,
.catalog-duplicate-state,
.catalog-mapping-summary {
  padding: 9px 10px;
  border: 1px solid #b8ddd5;
  background: var(--brand-soft);
}

.catalog-code-rules {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px;
  align-items: start;
}

.catalog-code-rules > svg {
  width: 18px;
  height: 18px;
  color: var(--brand);
}

.catalog-code-rules > div:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.catalog-code-rules strong {
  font-size: 9px;
}

.catalog-code-rules span {
  color: #5e6b77;
  font-size: 8px;
}

.catalog-rule-tokens {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.catalog-rule-tokens b,
.catalog-rule-tokens del {
  padding: 2px 5px;
  border: 1px solid #b5dcd2;
  border-radius: 4px;
  background: #fff;
  color: var(--brand-dark);
  font: 750 8px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-decoration: none;
}

.catalog-rule-tokens del {
  border-color: #e0caca;
  color: #a36262;
  text-decoration: line-through;
}

.catalog-code-rules[data-state="invalid"],
.catalog-duplicate-state[data-state="invalid"] {
  border-color: #e5b8b8;
  background: var(--red-soft);
  color: #a13f3f;
}

.catalog-duplicate-state {
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 9px;
  font-weight: 800;
}

.catalog-duplicate-state svg {
  width: 16px;
  height: 16px;
}

.catalog-mapping-summary {
  display: grid;
  gap: 3px;
  border-color: #d4dde4;
  background: #f7f9fb;
}

.catalog-mapping-summary strong {
  color: #687480;
  font-size: 8px;
}

.catalog-mapping-summary span {
  color: #25313d;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.45;
}

.catalog-form-actions {
  padding-top: 3px;
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 8px;
}

.catalog-form-actions button {
  min-height: 42px;
}

@media (max-width: 1180px) {
  .catalog-manager-body {
    grid-template-columns: 180px minmax(460px, 1fr) 360px;
  }

  .catalog-source-compact {
    display: none;
  }

  .catalog-table-head,
  .catalog-manager-row {
    grid-template-columns: minmax(140px, 1.5fr) 88px 96px 104px minmax(100px, 0.9fr) 50px;
  }
}

@media (max-width: 920px) {
  .catalog-modal {
    width: calc(100vw - 12px);
    height: calc(100vh - 12px);
    max-height: calc(100vh - 12px);
  }

  .catalog-manager-body {
    grid-template-columns: 168px minmax(500px, 1fr);
    overflow: auto;
  }

  .catalog-create-panel {
    grid-column: 1 / -1;
    min-height: 600px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 680px) {
  .catalog-modal-head {
    align-items: flex-start;
  }

  .catalog-modal-actions .primary-btn {
    padding-inline: 9px;
  }

  .catalog-manager-body {
    display: block;
    overflow: auto;
  }

  .catalog-manager-sidebar {
    padding: 8px;
    display: block;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .catalog-manager-sidebar section {
    margin-bottom: 8px;
  }

  .catalog-manager-sidebar h3,
  .catalog-sidebar-note {
    display: none;
  }

  .catalog-nav-list {
    display: flex;
    overflow-x: auto;
  }

  .catalog-nav-list button {
    width: auto;
    min-width: max-content;
  }

  .catalog-directory-panel {
    min-width: 760px;
    min-height: 420px;
  }

  .catalog-create-panel {
    min-height: 620px;
  }
}
}

.connection-options {
  padding: 12px;
  display: grid;
  gap: 8px;
}

.connection-option {
  min-height: 72px;
  padding: 12px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.connection-option:hover {
  border-color: #93c0b7;
  background: #f8fcfb;
}

.connection-option > svg:first-child {
  width: 25px;
  height: 25px;
  color: var(--brand);
}

.connection-option span {
  display: grid;
}

.connection-option small {
  margin-top: 3px;
  color: var(--muted);
}

.diagnostic-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 90;
  width: min(430px, 100%);
  height: 100vh;
  border-left: 1px solid var(--line-strong);
  background: #fff;
  box-shadow: -18px 0 50px rgba(24, 33, 43, 0.18);
  transform: translateX(105%);
  transition: transform 0.22s ease;
}

.diagnostic-drawer.open {
  transform: translateX(0);
}

.drawer-body {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.diagnostic-alert {
  padding: 10px;
  display: flex;
  gap: 8px;
  border: 1px solid #e0c18e;
  border-radius: 5px;
  background: var(--orange-soft);
  color: #87501c;
  font-size: 11px;
  font-weight: 750;
}

.diagnostic-references {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 2px 0;
  font-size: 11px;
}

.diagnostic-references strong {
  width: 100%;
  color: var(--ink);
}

.diagnostic-references a {
  color: var(--brand);
  font-weight: 750;
  text-decoration: none;
}

.diagnostic-references a:hover {
  text-decoration: underline;
}

.drawer-body textarea {
  min-height: 210px;
  resize: vertical;
  font: 11px/1.5 var(--mono);
}

.diagnostic-log {
  min-height: 140px;
  max-height: 240px;
  padding: 10px;
  overflow: auto;
  border: 1px solid #263343;
  border-radius: 5px;
  background: #111a26;
  color: #d9f1e8;
  font: 10px/1.55 var(--mono);
  white-space: pre-wrap;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 110;
  min-width: 310px;
  max-width: calc(100vw - 44px);
  padding: 12px 14px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid #9bcfc2;
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast > svg {
  width: 22px;
  height: 22px;
  color: var(--brand);
}

.toast div {
  display: grid;
}

.toast span {
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .brand {
    justify-content: center;
    padding-inline: 8px;
  }

  .brand-copy,
  .station-select div,
  .station-select > svg:last-child,
  .nav-item span,
  .nav-item kbd,
  .printer-mini div,
  .prototype-note span {
    display: none;
  }

  .station-select {
    margin: 10px auto;
    padding: 0;
    grid-template-columns: 1fr;
    place-items: center;
  }

  .nav-item {
    grid-template-columns: 1fr;
    place-items: center;
    padding: 0;
  }

  .printer-mini {
    grid-template-columns: 1fr;
    place-items: center;
  }

  .workbench-grid {
    grid-template-columns: minmax(0, 1fr) 350px;
  }

  .template-editor {
    grid-template-columns: 200px minmax(460px, 1fr) 280px;
  }

  .device-capabilities {
    display: none;
  }
}

@media (max-width: 920px) {
  .workbench-grid,
  .batch-layout,
  .device-layout {
    grid-template-columns: 1fr;
  }

  .preview-column,
  .device-settings {
    position: static;
  }

  .preview-column {
    order: -1;
  }

  .template-editor {
    grid-template-columns: 174px minmax(0, 1fr);
  }

  .property-panel {
    grid-column: 1 / -1;
    max-height: none;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 720px) {
  .fixed-station-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .fixed-station-card .secondary-btn {
    grid-column: 1 / -1;
  }

  body {
    padding-bottom: 62px;
  }

  body.sidebar-collapsed {
    padding-bottom: 0;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 60;
    height: 62px;
    display: block;
    border-top: 1px solid var(--line);
    border-right: 0;
  }

  .brand,
  .station-select,
  .sidebar-footer {
    display: none;
  }

  .nav-list {
    height: 100%;
    padding: 4px 3px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2px;
  }

  .nav-item {
    min-height: 52px;
    display: grid;
    grid-template-columns: 1fr;
    place-items: center;
    gap: 1px;
    padding: 3px;
    font-size: 9px;
  }

  .nav-item span {
    display: block;
  }

  .nav-item svg {
    width: 19px;
    height: 19px;
  }

  .topbar {
    height: 62px;
    padding: 0 12px;
  }

  .breadcrumb,
  .connection-copy small,
  .top-actions > .icon-btn,
  .avatar {
    display: none;
  }

  .top-actions > .icon-btn.preview-toggle,
  .top-actions > .icon-btn.operator-guide-trigger {
    display: inline-grid;
  }

  .operator-guide-modal {
    max-height: calc(100vh - 20px);
  }

  .operator-guide-body {
    padding: 12px;
  }

  .operator-guide-status {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .operator-guide-status .secondary-btn {
    grid-column: 1 / -1;
    width: 100%;
  }

  .operator-guide-steps {
    grid-template-columns: 1fr;
  }

  .operator-guide-steps li {
    min-height: 82px;
  }

  .operator-guide-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .operator-guide-footer .inline-actions,
  .operator-guide-footer .inline-actions > * {
    width: 100%;
  }

  .windows-usb-modal {
    max-height: calc(100vh - 16px);
  }

  .windows-usb-body {
    padding: 10px;
  }

  .windows-usb-status,
  .windows-usb-steps li {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .windows-usb-status .secondary-btn,
  .windows-usb-steps li > :last-child {
    grid-column: 1 / -1;
  }

  .windows-usb-links {
    padding-left: 39px;
  }

  h1 {
    font-size: 17px;
  }

  .connection-button {
    min-height: 38px;
    padding: 5px 8px;
  }

  .connection-copy strong {
    font-size: 10px;
  }

  .page {
    padding: 10px;
  }

  .printer-strip {
    align-items: flex-start;
  }

  .printer-strip-actions {
    display: none;
  }

  .separator,
  .printer-strip-main > span:not(.status-dot) {
    display: none;
  }

  .workbench-grid {
    margin-top: 10px;
    gap: 10px;
  }

  .preview-column {
    order: 0;
  }

  .scan-section,
  .result-section,
  .print-content-section,
  .queue-section {
    padding: 13px;
  }

  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .segmented {
    width: 100%;
  }

  .segmented button {
    flex: 1;
  }

  .scan-input-wrap {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .scan-input-wrap input {
    font-size: 16px;
  }

  .clear-scan {
    display: none;
  }

  .scan-input-wrap .primary-btn {
    min-width: 44px;
    padding: 0;
  }

  .scan-input-wrap .primary-btn span {
    display: none;
  }

  .scan-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .scan-meta-actions {
    width: 100%;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
  }

  .result-actions .check-control {
    display: none;
  }

  .result-table {
    min-width: 690px;
  }

  .result-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .sample-filter {
    grid-column: 1 / -1;
  }

  .manual-context-bar {
    top: 68px;
    align-items: stretch;
    flex-direction: column;
  }

  .sequencing-mode-bar,
  .sequencing-mode-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .sequencing-mode-actions,
  .sequencing-print-mode {
    width: 100%;
  }

  .sequencing-print-mode button {
    min-width: 0;
  }

  .sequencing-customer-option {
    justify-content: flex-start;
  }

  .sequencing-member-panel-head,
  .sequencing-member-group header {
    align-items: flex-start;
  }

  .print-content-actions,
  .manual-context-actions {
    width: 100%;
    justify-content: space-between;
  }

  .apply-scope {
    width: 100%;
  }

  .apply-scope button {
    min-width: 0;
    flex: 1;
  }

  .quick-print-btn {
    width: 100%;
    min-width: 0;
    order: -1;
  }

  .category-selector {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .category-selector .category-tile {
    min-height: 60px;
  }

  .label-list-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 7px;
  }

  .label-filter {
    width: 100%;
  }

  .label-option-list {
    max-height: 340px;
  }

  .label-option-group-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .queue-row {
    grid-template-columns: 28px minmax(0, 1fr) auto;
  }

  .queue-row > .state-badge {
    display: none;
  }

  .primary-print-actions {
    grid-template-columns: 1fr;
  }

  .primary-print-actions .print-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .print-runtime-status {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .print-runtime-status .text-btn {
    grid-column: 2;
    justify-self: start;
  }

  .catalog-manager-body {
    overflow: auto;
  }

  .catalog-add-form {
    grid-template-columns: 1fr;
  }

  .catalog-add-form .primary-btn {
    grid-column: auto;
    width: 100%;
  }

  .catalog-manager-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .catalog-manager-toolbar .label-filter {
    width: 100%;
  }

  .catalog-manager-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .catalog-manager-row .catalog-category {
    grid-column: 1;
    justify-self: start;
  }

  .catalog-manager-row > div {
    grid-column: 1;
  }

  .catalog-manager-row > .icon-btn {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .label-stage {
    min-height: 240px;
  }

  .tube-label {
    width: 300px;
  }

  .page-intro {
    align-items: stretch;
    flex-direction: column;
  }

  .page-intro .inline-actions,
  .page-intro > .primary-btn {
    width: 100%;
  }

  .page-intro .inline-actions > * {
    flex: 1;
  }

  .batch-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .template-editor {
    min-height: 630px;
    display: block;
    overflow: visible;
  }

  .template-list {
    max-height: 190px;
    overflow: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  #templateList {
    display: flex;
    overflow-x: auto;
  }

  .template-family {
    width: 220px;
    flex: 0 0 220px;
    margin: 6px;
  }

  .template-variants {
    padding-left: 8px;
  }

  .design-stage {
    min-height: 360px;
  }

  .design-toolbar {
    overflow-x: auto;
  }

  .design-status {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .property-panel {
    display: block;
  }

  .device-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "icon name action";
  }

  .device-media,
  .device-row > .state-badge {
    display: none;
  }

  .device-row > .secondary-btn {
    padding-inline: 9px;
  }

  .device-command-grid {
    grid-template-columns: 1fr 1fr;
  }

  .jobs-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .jobs-metrics > div:nth-child(2) {
    border-right: 0;
  }

  .jobs-metrics > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .toast {
    right: 12px;
    bottom: 74px;
    left: 12px;
    min-width: 0;
    max-width: none;
  }
}
