:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #657084;
  --line: #dfe5ef;
  --brand: #1769e0;
  --brand-dark: #0f4ea8;
  --ok: #19a35b;
  --warn: #e2a100;
  --bad: #d83434;
  --idle: #8d99aa;
  --curve-temperature: #dc2626;
  --curve-power: #16a34a;
  --curve-anomaly: #7c3aed;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

[hidden] {
  display: none !important;
}

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

.auth-screen {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background: #eef3fb;
}

.login-card {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 24px;
  box-shadow: 0 18px 46px rgba(23, 32, 51, 0.12);
}

.login-brand {
  margin-bottom: 22px;
  color: var(--ink);
}

.login-card label {
  margin-bottom: 12px;
}

.login-card input {
  width: 100%;
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  background: #101827;
  color: #ffffff;
  padding: 24px 18px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 28px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--brand);
  font-weight: 800;
}

.brand small {
  display: block;
  margin-top: 4px;
  color: #aeb8c8;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  padding: 12px 14px;
  background: transparent;
  color: #cbd5e3;
  text-align: left;
  cursor: pointer;
}

.nav-item.active,
.nav-item:hover {
  background: #22304a;
  color: #ffffff;
}

.site-icp {
  color: #8793a7;
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}

.site-icp span,
.site-icp a {
  display: block;
}

.site-icp a {
  color: inherit;
  text-decoration: none;
}

.site-icp a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.login-icp {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.login-icp a:hover {
  color: var(--brand-dark);
}

.sidebar-icp {
  margin-top: auto;
  padding-top: 24px;
}

.main {
  padding: 24px;
  overflow: hidden;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.userbar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 5px;
  font-size: 26px;
}

h2 {
  margin-bottom: 12px;
  font-size: 18px;
}

.topbar p,
.section-head p {
  margin-bottom: 0;
  color: var(--muted);
}

.connection {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--panel);
  color: var(--muted);
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 99px;
  background: var(--warn);
}

.connection.live .dot {
  background: var(--ok);
}

.connection.warning .dot {
  background: #d97706;
}

.connection.error .dot {
  background: #dc2626;
}

.data-freshness-banner {
  margin: -8px 0 16px;
  padding: 11px 14px;
  border: 1px solid #f0c36d;
  border-radius: 8px;
  background: #fff8e7;
  color: #7a4800;
  line-height: 1.5;
}

.data-freshness-banner.error {
  border-color: #efaaaa;
  background: #fff1f1;
  color: #a11d1d;
}

.data-unavailable-panel {
  grid-column: 1 / -1;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(84px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.summary-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.summary-card {
  padding: 16px;
}

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

.summary-card strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
}

.summary-card small {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-summary-total {
  border-color: #b8c9df;
  background: #f2f6fb;
  color: #294b75;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  min-width: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  background: #ffffff;
  color: var(--ink);
}

.device-grid {
  display: grid;
  gap: 10px;
}

.device-grid.layout-5x5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.device-grid.layout-10x5,
.device-grid.layout-10x10 {
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 6px;
}

.device-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.dashboard-card {
  min-width: 0;
  padding: 12px;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.dashboard-card.state-aging {
  border-color: #77c994;
  background: #e4f7eb;
}

.dashboard-card.state-failed {
  border-color: #ef8585;
  background: #ffe5e5;
}

.dashboard-card.state-paused {
  border-color: #e6ad44;
  background: #fff4d6;
}

.dashboard-card.state-idle {
  border-color: #8bb5f2;
  background: #eaf2ff;
}

.dashboard-card.state-offline {
  border-color: #aeb6c2;
  background: #e4e8ed;
  color: #626d7b;
}

.dashboard-card.state-aging .dashboard-card-head span,
.dashboard-summary-running {
  color: #117a43;
}

.dashboard-summary-running {
  border-color: #b8dfc9;
  background: #f0faf5;
}

.dashboard-card.state-failed .dashboard-card-head span,
.dashboard-summary-failed {
  color: #b42323;
}

.dashboard-summary-failed {
  border-color: #f0b9b9;
  background: #fff2f2;
}

.dashboard-card.state-paused .dashboard-card-head span,
.dashboard-summary-paused {
  color: #8a4b00;
}

.dashboard-summary-paused {
  border-color: #e7c277;
  background: #fff8e8;
}

.dashboard-card.state-idle .dashboard-card-head span,
.dashboard-summary-idle {
  color: #175eb5;
}

.dashboard-summary-idle {
  border-color: #bfd3f1;
  background: #f1f6fd;
}

.dashboard-card.state-offline .dashboard-card-head span,
.dashboard-summary-offline {
  color: #596270;
}

.dashboard-summary-offline {
  border-color: #cbd1d9;
  background: #f0f2f5;
}

.dashboard-summary-today-total {
  border-color: #9ed5df;
  background: #eefbfc;
  color: #0e6673;
}

.dashboard-summary-today-pass {
  border-color: #9fd7b8;
  background: #edfaf3;
  color: #08733e;
}

.dashboard-summary-today-fail {
  border-color: #efb0b0;
  background: #fff1f1;
  color: #b42323;
}

@media (max-width: 1200px) {
  .summary-grid {
    grid-template-columns: repeat(5, minmax(100px, 1fr));
  }
}

.dashboard-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.dashboard-card-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-card-head span {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 3px 6px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 700;
}

.dashboard-meta,
.dashboard-foot {
  margin-top: 6px;
  overflow: hidden;
  color: #5f6c7b;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.dashboard-metrics span {
  min-width: 0;
  border-radius: 6px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.62);
}

.dashboard-metrics small,
.dashboard-metrics strong {
  display: block;
}

.dashboard-metrics small {
  color: #657282;
  font-size: 10px;
}

.dashboard-metrics strong {
  margin-top: 2px;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
}

.dashboard-record-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid rgba(74, 86, 101, 0.16);
}

.dashboard-record-stats span {
  min-width: 0;
  text-align: center;
}

.dashboard-record-stats small,
.dashboard-record-stats strong {
  display: block;
}

.dashboard-record-stats small {
  color: #657282;
  font-size: 10px;
}

.dashboard-record-stats strong {
  margin-top: 1px;
  font-size: 14px;
}

.dashboard-record-stats .record-pass strong {
  color: #167446;
}

.dashboard-record-stats .record-fail strong {
  color: #b42318;
}

.health-good,
.health-stable {
  color: #167446 !important;
}

.health-warning {
  color: #9a6700 !important;
}

.health-risk {
  color: var(--bad) !important;
}

.health-unknown {
  color: var(--muted) !important;
}

.dashboard-error {
  margin-top: 8px;
  overflow: hidden;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layout-10x5 .dashboard-card,
.layout-10x10 .dashboard-card {
  padding: 7px;
}

.layout-10x5 .dashboard-card-head strong,
.layout-10x10 .dashboard-card-head strong {
  display: -webkit-box;
  min-height: 30px;
  overflow: hidden;
  font-size: 12px;
  line-height: 15px;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.layout-10x5 .dashboard-card-head,
.layout-10x10 .dashboard-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
}

.layout-10x5 .dashboard-card-head span,
.layout-10x10 .dashboard-card-head span {
  justify-self: start;
  padding: 2px 4px;
  font-size: 9px;
}

.layout-10x5 .dashboard-meta,
.layout-10x10 .dashboard-meta {
  font-size: 9px;
}

.layout-10x5 .dashboard-metrics,
.layout-10x10 .dashboard-metrics {
  gap: 4px;
  margin-top: 6px;
}

.layout-10x5 .dashboard-metrics span,
.layout-10x10 .dashboard-metrics span {
  padding: 4px;
}

.layout-10x5 .dashboard-metrics strong,
.layout-10x10 .dashboard-metrics strong {
  font-size: 11px;
}

.layout-10x5 .dashboard-record-stats,
.layout-10x10 .dashboard-record-stats {
  gap: 2px;
  margin-top: 5px;
  padding-top: 4px;
}

.layout-10x5 .dashboard-record-stats small,
.layout-10x10 .dashboard-record-stats small {
  font-size: 8px;
}

.layout-10x5 .dashboard-record-stats strong,
.layout-10x10 .dashboard-record-stats strong {
  font-size: 11px;
}

.layout-10x5 .dashboard-secondary,
.layout-10x10 .dashboard-secondary {
  display: none;
}

.layout-10x5 .dashboard-error,
.layout-10x10 .dashboard-error {
  margin-top: 5px;
  font-size: 9px;
}

.dashboard-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.dashboard-pager > div {
  display: flex;
  gap: 8px;
}

.device-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.device-head strong {
  display: block;
  margin-bottom: 4px;
}

.device-head small {
  color: var(--muted);
}

.badge {
  align-self: start;
  border-radius: 999px;
  padding: 5px 9px;
  background: #e8f3ff;
  color: var(--brand-dark);
  font-size: 12px;
}

.channel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 14px;
}

.channel {
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}

.channel.running {
  border-color: #b4d9c6;
  background: #f0fbf5;
}

.channel.done {
  border-color: #a9c7ff;
  background: #eef5ff;
}

.channel.alarm {
  border-color: #ffb4b4;
  background: #fff0f0;
  animation: pulse 1.1s ease-in-out infinite;
}

.channel.paused {
  border-color: #e7bf6b;
  background: #fff7e2;
  color: #7a4800;
}

.channel.idle {
  background: #f4f6f9;
  color: var(--idle);
}

.channel-top {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 7px;
  font-weight: 700;
}

.channel-top span:last-child {
  font-size: 12px;
}

.channel-data {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.section-head {
  margin-bottom: 16px;
}

.devices-section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
}

.devices-section-head .primary {
  flex: none;
}

.devices-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
}

.devices-head-actions select {
  min-width: 120px;
}

.devices-head-actions label {
  gap: 4px;
  font-size: 12px;
}

.device-search-field input {
  width: 220px;
  padding: 8px 10px;
}

#deviceFilterCount {
  padding: 10px 0;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
  vertical-align: middle;
}

th {
  background: #f7f9fc;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}

.table-sort {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-weight: inherit;
  white-space: nowrap;
}

.table-sort:hover,
.table-sort.active {
  color: var(--brand-dark);
}

.table-sort span {
  min-width: 10px;
  color: var(--brand);
}

td {
  font-size: 14px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 8px;
  background: #eef5ff;
  color: var(--brand-dark);
  white-space: nowrap;
}

.status.pass {
  background: #eaf8f0;
  color: #0c7d43;
}

.status.pass.attention {
  background: #fff0bd;
  color: #835600;
}

.status.paused {
  background: #fff0bd;
  color: #835600;
}

.status.incomplete {
  background: #fff6dd;
  color: #8a5a00;
}

.status.fail {
  background: #fff0f0;
  color: var(--bad);
}

.status.running {
  background: #fff7df;
  color: #9a6700;
}

.device-imei {
  display: grid;
  gap: 3px;
  white-space: nowrap;
}

.device-imei small {
  color: var(--muted);
}

.device-imei.mismatch strong,
.device-imei.mismatch small {
  color: var(--bad);
}

.device-imei .credential-mode {
  width: fit-content;
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 11px;
}

.device-imei .credential-mode.device {
  background: #e6f7ee;
  color: #087443;
}

.device-imei .credential-mode.legacy {
  background: #fff3d6;
  color: #835600;
}

.device-name-editor {
  display: flex;
  min-width: 180px;
}

.device-name-editor input {
  width: 100%;
  min-width: 150px;
  padding: 7px 9px;
}

.device-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 68px;
}

.device-actions .secondary-button {
  padding: 6px 8px;
}

.device-action-menu {
  position: relative;
}

.device-action-menu summary {
  min-width: 58px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 9px;
  background: #ffffff;
  color: var(--brand);
  cursor: pointer;
  list-style: none;
  text-align: center;
  white-space: nowrap;
}

.device-action-menu summary::-webkit-details-marker {
  display: none;
}

.device-action-menu summary::after {
  margin-left: 5px;
  color: var(--muted);
  content: "▾";
}

.device-action-menu[open] summary {
  border-color: var(--brand);
  background: #eaf3ff;
}

.device-action-menu > div {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 20;
  display: grid;
  width: 126px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px;
  box-shadow: 0 8px 24px rgba(18, 36, 65, 0.16);
  background: #ffffff;
}

.device-action-menu button {
  border: 0;
  border-radius: 4px;
  padding: 8px 9px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.device-action-menu button:hover {
  background: #edf4ff;
  color: var(--brand-dark);
}

.device-action-menu button.danger-button {
  color: var(--bad);
}

.device-action-menu button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.device-pager,
.record-pager,
.raw-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 2px 0;
  color: var(--muted);
  font-size: 13px;
}

.device-pager > div,
.record-pager > div,
.raw-pager > div {
  display: flex;
  gap: 6px;
}

.device-pager .secondary-button,
.record-pager .secondary-button,
.raw-pager .secondary-button {
  padding: 6px 9px;
}

.device-empty-row {
  padding: 36px 16px;
  color: var(--muted);
  text-align: center;
}

.curve-panel {
  margin-bottom: 16px;
  min-height: 260px;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 20;
}

.modal.open {
  display: block;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
}

.modal-dialog {
  position: relative;
  width: min(1040px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  margin: 24px auto;
  overflow: auto;
  border-radius: 8px;
  background: var(--panel);
  padding: 20px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.24);
}

.modal-close {
  position: sticky;
  top: 0;
  float: right;
  z-index: 1;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.modal-close:hover {
  color: var(--ink);
  border-color: var(--brand);
}

.device-create-dialog {
  width: min(680px, calc(100vw - 32px));
}

.device-create-head {
  padding-right: 46px;
  margin-bottom: 18px;
}

.device-create-head h2 {
  margin: 4px 0 7px;
  font-size: 22px;
}

.device-create-head p,
.device-create-fields small {
  margin: 0;
  color: var(--muted);
}

.device-create-product {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 13px;
  background: #f7f9fc;
  font-size: 13px;
}

.device-create-product span {
  color: var(--muted);
}

.device-create-fields input,
.device-create-fields select,
.device-create-fields textarea {
  width: 100%;
  min-width: 0;
}

.device-create-fields textarea {
  resize: vertical;
}

.device-create-description {
  grid-column: 1 / -1;
}

.device-create-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.device-create-actions .primary {
  margin-top: 0;
}

.claim-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.claim-button span {
  min-width: 20px;
  border-radius: 999px;
  padding: 2px 6px;
  background: #d83434;
  color: #ffffff;
  font-size: 11px;
  text-align: center;
}

.device-claims-dialog {
  width: min(900px, calc(100vw - 32px));
}

.device-claim-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9fc;
}

.device-claim-summary span {
  padding: 10px 14px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.device-claim-summary span:last-child {
  border-right: 0;
}

.device-claim-summary strong {
  margin-right: 4px;
  color: var(--ink);
  font-size: 17px;
}

.device-claim-list {
  display: grid;
  gap: 10px;
}

.device-claim-card {
  border: 1px solid var(--line);
  border-left: 4px solid #90a0b8;
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
}

.device-claim-card.status-pending {
  border-left-color: #e59b00;
}

.device-claim-card.status-approved,
.device-claim-card.status-delivered {
  border-left-color: #159455;
}

.device-claim-card.status-rejected,
.device-claim-card.status-expired,
.device-claim-card.status-revoked {
  border-left-color: #c44848;
}

.device-claim-head,
.device-claim-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.device-claim-head > div {
  display: grid;
  gap: 3px;
}

.device-claim-head span,
.device-claim-meta,
.device-claim-result {
  color: var(--muted);
  font-size: 12px;
}

.claim-status {
  border-radius: 999px;
  padding: 5px 9px;
  background: #f1f4f8;
  white-space: nowrap;
}

.device-claim-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 9px;
}

.device-claim-fields {
  display: grid;
  grid-template-columns: minmax(180px, 0.75fr) minmax(0, 1fr) minmax(180px, 0.55fr);
  gap: 10px;
  margin-top: 12px;
}

.device-claim-fields input,
.device-claim-fields select {
  width: 100%;
  min-width: 0;
}

.device-claim-fields small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.device-claim-fields input[readonly] {
  background: #f1f4f8;
  color: var(--muted);
}

.device-claim-actions {
  justify-content: flex-end;
  margin-top: 12px;
}

.device-claim-result {
  margin-top: 11px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.device-claim-empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 36px 18px;
  color: var(--muted);
  text-align: center;
}

.device-reclaim-section {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.device-reclaim-heading {
  margin-bottom: 10px;
}

.device-reclaim-heading > div {
  display: grid;
  gap: 3px;
}

.device-reclaim-heading small {
  color: var(--muted);
}

.device-reclaim-fields {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, .7fr) auto auto;
  align-items: end;
  gap: 10px;
  margin-top: 12px;
}

.device-reclaim-fields input {
  width: 100%;
}

.device-reclaim-check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  white-space: nowrap;
}

.device-reclaim-check input {
  width: auto;
}

.message.success {
  color: var(--ok);
}

.message.warning {
  color: #8a5a00;
}

.curve-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 12px;
}

.curve-head p,
.curve-empty {
  color: var(--muted);
}

.curve-head-context {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.curve-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.curve-stat {
  border-radius: 8px;
  background: #f4f7fb;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 13px;
}

.curve-stat strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 16px;
}

.analysis-loading {
  min-height: 220px;
  display: grid;
  place-items: center;
}

.curve-error {
  border: 1px solid #f1b5b5;
  border-radius: 8px;
  padding: 18px;
  background: #fff3f3;
  color: var(--bad);
}

.ai-analysis {
  margin: 14px 0;
  border: 1px solid #cdd9ea;
  border-left: 5px solid var(--brand);
  border-radius: 8px;
  padding: 15px;
  background: #f7faff;
}

.ai-analysis.normal,
.ai-analysis.running {
  border-left-color: var(--ok);
  background: #f3fbf7;
}

.ai-analysis.warning {
  border-left-color: var(--warn);
  background: #fffbef;
}

.ai-analysis.fault {
  border-left-color: var(--bad);
  background: #fff5f5;
}

.ai-analysis.insufficient {
  border-left-color: var(--idle);
  background: #f7f8fa;
}

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

.ai-analysis-head h3 {
  margin: 4px 0 0;
  font-size: 20px;
}

.ai-kicker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.ai-confidence {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 10px;
  background: #ffffff;
  color: var(--ink);
  font-size: 13px;
}

.ai-summary {
  margin: 10px 0 12px;
  line-height: 1.65;
}

.ai-thermal-profile {
  margin: 0 0 12px;
  border: 1px solid rgba(29, 119, 78, 0.2);
  border-radius: 6px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.72);
}

.ai-thermal-profile-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}

.ai-thermal-profile-head span {
  color: var(--muted);
  font-size: 12px;
}

.ai-thermal-profile-head strong {
  font-size: 14px;
}

.ai-phase-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.ai-phase {
  min-width: 0;
  border-left: 3px solid #df9700;
  padding: 6px 8px;
  background: #fff9eb;
}

.ai-phase.regulated {
  border-left-color: #2784d8;
  background: #f1f8ff;
}

.ai-phase.holding {
  border-left-color: var(--ok);
  background: #eefaf3;
}

.ai-phase small,
.ai-phase strong,
.ai-phase em {
  display: block;
}

.ai-phase small,
.ai-phase em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.ai-phase strong {
  margin: 2px 0 3px;
  font-size: 13px;
}

.ai-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
}

.ai-metrics span {
  min-width: 0;
  border: 1px solid rgba(99, 115, 140, 0.16);
  border-radius: 6px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.ai-metrics small,
.ai-metrics strong {
  display: block;
}

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

.ai-metrics strong {
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.ai-report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: 16px;
  margin-top: 14px;
}

.ai-report-grid h4 {
  margin: 0 0 8px;
  font-size: 14px;
}

.ai-anomaly-list {
  display: grid;
  gap: 7px;
}

.ai-anomaly {
  border-left: 3px solid var(--warn);
  padding: 7px 9px;
  background: rgba(255, 255, 255, 0.8);
}

.ai-anomaly.fault {
  border-left-color: var(--bad);
}

.ai-anomaly > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.ai-anomaly time,
.ai-anomaly small,
.ai-empty,
.ai-notice {
  color: var(--muted);
  font-size: 12px;
}

.ai-anomaly p {
  margin: 4px 0;
  font-size: 13px;
}

.ai-recommendations {
  margin: 0;
  padding-left: 20px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.65;
}

.ai-notice {
  margin: 12px 0 0;
  border-top: 1px solid rgba(99, 115, 140, 0.14);
  padding-top: 9px;
}

.error-list {
  display: grid;
  gap: 4px;
}

.error-item {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 3px 8px;
  background: #fff0f0;
  color: var(--bad);
  font-size: 12px;
}

.error-item.ok {
  background: #eaf8f0;
  color: #0c7d43;
}

.status-code {
  color: var(--muted);
  font-size: 12px;
}

.record-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.category-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
}

.category-button.active,
.category-button:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
  background: #eaf3ff;
}

#records .toolbar {
  gap: 8px 10px;
  margin-bottom: 10px;
}

#records .toolbar label {
  gap: 4px;
}

#records .toolbar input,
#records .toolbar select {
  min-width: 130px;
  padding: 7px 9px;
}

#records #recordPsn {
  width: 210px;
}

#records #recordFault {
  width: 180px;
}

#records #recordStartDate,
#records #recordEndDate {
  width: 150px;
}

#recordFilterCount {
  padding: 9px 0;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.record-history-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -2px 0 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f9fc;
}

.record-history-status {
  color: var(--muted);
  font-size: 12px;
}

.record-history-status.complete {
  color: #0c7d43;
}

.record-history-status.loading,
.record-history-status.warning {
  color: #8a5b00;
}

.record-history-status.error {
  color: var(--bad);
}

.record-history-bar button {
  flex: 0 0 auto;
  padding: 6px 10px;
}

.record-history-actions,
.table-column-tools,
.table-column-panel {
  display: flex;
  align-items: center;
  gap: 8px;
}

.record-history-actions {
  margin-left: auto;
}

.table-column-panel {
  flex: 1 0 100%;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.table-column-panel[hidden] {
  display: none;
}

.table-column-panel label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.table-column-panel select {
  min-width: 150px;
  padding: 6px 30px 6px 9px;
}

.table-column-panel input[type="range"] {
  width: min(280px, 30vw);
  min-width: 140px;
  padding: 0;
}

.table-column-panel output {
  min-width: 48px;
  color: var(--ink);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.table-column-step {
  width: 32px;
  height: 32px;
  padding: 0 !important;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--primary);
  font-size: 18px;
  cursor: pointer;
}

.record-table-wrap {
  max-height: calc(100vh - 290px);
  min-height: 320px;
  overscroll-behavior-inline: contain;
}

.record-management-table {
  min-width: 1280px;
  width: 1740px;
  table-layout: fixed;
}

.record-management-table th:nth-child(1) {
  width: 50px;
}

.record-management-table th:nth-child(2) {
  width: 100px;
}

.record-management-table th:nth-child(3) {
  width: 140px;
}

.record-management-table th:nth-child(4) {
  width: 200px;
}

.record-management-table th:nth-child(5) {
  width: 130px;
}

.record-management-table th:nth-child(6) {
  width: 180px;
}

.record-management-table th:nth-child(7) {
  width: 160px;
}

.record-management-table th:nth-child(8) {
  width: 145px;
}

.record-management-table th:nth-child(9) {
  width: 180px;
}

.record-management-table th:nth-child(10) {
  width: 150px;
}

.record-management-table th:nth-child(11) {
  width: 110px;
}

.record-management-table th:nth-child(12) {
  width: 70px;
}

.record-management-table th:nth-child(13),
.record-management-table td:nth-child(13) {
  width: 132px;
  min-width: 132px;
}

#records .record-management-table th,
#records .record-management-table td {
  padding: 6px 9px;
}

#records .record-management-table td {
  height: 50px;
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.25;
}

.record-management-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
}

.resizable-table thead th {
  box-sizing: border-box;
}

.table-column-resizer {
  position: absolute;
  top: 0;
  right: -5px;
  bottom: 0;
  z-index: 9;
  width: 10px;
  cursor: col-resize;
  touch-action: none;
}

.table-column-resizer::after {
  position: absolute;
  top: 18%;
  right: 4px;
  bottom: 18%;
  width: 1px;
  background: #c5cfdd;
  content: "";
}

.table-column-resizer:hover::after,
.table-column-resizer:focus-visible::after,
.table-column-resizer.active::after {
  width: 2px;
  background: var(--brand);
}

.table-column-resizer:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

body.table-column-resizing,
body.table-column-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

.record-management-table th:last-child,
.record-management-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 4;
  background: #ffffff;
  box-shadow: -8px 0 12px -12px rgba(18, 36, 65, 0.45);
  text-align: center;
}

.record-management-table .record-curve-column {
  overflow: visible;
}

.record-management-table thead th:last-child {
  z-index: 7;
  background: #f7f9fc;
}

.record-management-table tr.record-quality-perfect td {
  background: #f2fbf5;
}

.record-management-table tr.record-quality-attention td {
  background: #fff8dc;
}

.record-management-table tr.record-quality-perfect td:last-child {
  background: #f2fbf5;
}

.record-management-table tr.record-quality-attention td:last-child {
  background: #fff8dc;
}

.record-select-column {
  text-align: center;
}

.record-select-column input {
  width: 16px;
  min-width: 16px;
  max-width: 16px;
  height: 16px;
  padding: 0;
  margin: 0;
  accent-color: var(--brand);
  cursor: pointer;
}

.record-batch-actions {
  display: flex;
  min-height: 50px;
  margin: 0 0 10px;
  align-items: center;
  gap: 10px;
  border: 1px solid #cbd8eb;
  border-radius: 8px;
  padding: 8px 12px;
  background: #f7faff;
}

.record-batch-actions > div {
  display: grid;
  margin-right: auto;
  gap: 2px;
}

.record-batch-actions > div span {
  color: var(--muted);
  font-size: 12px;
}

.record-batch-actions > div b {
  color: var(--brand-dark);
}

.record-batch-analysis-dialog {
  width: min(1180px, calc(100vw - 32px));
}

.record-order-link-dialog {
  width: min(760px, calc(100vw - 32px));
}

.record-order-link-head {
  padding-right: 44px;
}

.record-order-link-head > span {
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.record-order-link-head h2 {
  margin: 3px 0 6px;
}

.record-order-link-head p {
  margin: 0;
  color: var(--muted);
}

.record-order-link-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.record-order-link-targets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.record-order-link-form textarea {
  min-height: 82px;
}

.record-order-link-form > button {
  justify-self: start;
}

.record-batch-analysis-head span,
.record-batch-result-head span {
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.record-batch-analysis-head h2,
.record-batch-result-head h3 {
  margin: 3px 0 6px;
}

.record-batch-analysis-head p {
  margin: 0;
  color: var(--muted);
}

.record-batch-analysis-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  gap: 12px;
  margin-top: 18px;
  align-items: end;
}

.record-batch-selection-summary {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 14px;
  background: #f8fafc;
  white-space: nowrap;
}

.record-batch-loading {
  margin-top: 16px;
  border: 1px dashed #b8c7dc;
  border-radius: 8px;
  padding: 32px 16px;
  color: var(--muted);
  text-align: center;
}

.record-batch-result {
  display: grid;
  gap: 16px;
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.record-batch-result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.record-batch-result-head > strong {
  border-radius: 999px;
  padding: 7px 12px;
  background: #eaf3ff;
  color: var(--brand-dark);
}

.record-batch-totals {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.record-batch-totals span {
  display: grid;
  gap: 3px;
  border-right: 1px solid var(--line);
  padding: 10px 14px;
}

.record-batch-totals span:last-child {
  border-right: 0;
}

.record-batch-totals small,
.record-batch-parameter-head p,
.record-batch-parameter-grid article > small {
  color: var(--muted);
}

.record-batch-summary {
  margin: 0;
  border-left: 4px solid var(--brand);
  padding: 12px 14px;
  background: #f4f8ff;
  line-height: 1.7;
}

.record-batch-findings {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.record-batch-findings section,
.record-batch-result > section.wide {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
}

.record-batch-findings h4,
.record-batch-result > section.wide h4,
.record-batch-parameters h4 {
  margin: 0 0 8px;
}

.record-batch-findings ul,
.record-batch-result > section.wide ul {
  margin: 0;
  padding-left: 20px;
  line-height: 1.65;
}

.record-batch-findings li small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.record-batch-findings section > p,
.record-batch-result > section.wide > p {
  margin: 0;
  color: var(--muted);
}

.record-batch-parameter-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.record-batch-parameter-head p {
  margin: 0;
}

.record-batch-parameter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.record-batch-parameter-grid article {
  display: grid;
  align-content: start;
  gap: 8px;
  border: 1px solid #cbd8e8;
  border-top: 3px solid #4d8bd8;
  border-radius: 7px;
  padding: 12px;
  background: #fff;
}

.record-batch-parameter-grid article.adjust {
  border-top-color: var(--warn);
  background: #fffdf5;
}

.record-batch-parameter-grid article.insufficient {
  border-top-color: #94a3b8;
  background: #f8fafc;
}

.record-batch-parameter-grid article.accepted {
  border-color: #8fd2aa;
  border-top-color: var(--ok);
  background: #f2fbf6;
}

.record-batch-parameter-grid article.rejected {
  border-color: #cbd5e1;
  border-top-color: #94a3b8;
  background: #f8fafc;
}

.record-batch-parameter-grid header,
.record-batch-parameter-values {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.record-batch-parameter-grid header span {
  color: var(--muted);
  font-size: 11px;
}

.record-batch-parameter-values {
  border-radius: 5px;
  padding: 7px 9px;
  background: #f3f6fa;
  font-size: 12px;
}

.record-batch-parameter-grid article > p {
  margin: 0;
  line-height: 1.55;
}

.record-batch-parameter-grid article > small {
  line-height: 1.45;
}

.record-batch-bulk-actions,
.record-batch-parameter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.record-batch-bulk-actions {
  flex: 0 0 auto;
}

.record-batch-parameter-actions {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 9px;
}

.record-batch-parameter-actions button {
  min-width: 0;
  flex: 1;
  padding: 7px 9px;
}

.record-batch-decision {
  margin-top: auto;
  border-radius: 5px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.record-batch-decision.accepted {
  background: #dff5e8;
  color: #18743b;
}

.record-batch-notice {
  margin: 0;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 820px) {
  .record-batch-actions,
  .record-batch-result-head {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .record-batch-analysis-form,
  .record-batch-findings,
  .record-batch-parameter-grid {
    grid-template-columns: 1fr;
  }

  .record-batch-parameter-head {
    display: grid;
  }

  .record-batch-totals {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .record-batch-totals span:nth-child(2) {
    border-right: 0;
  }

  .record-batch-totals span:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
}

.table-help-mark {
  display: inline-flex;
  width: 16px;
  height: 16px;
  margin-left: 3px;
  align-items: center;
  justify-content: center;
  border: 1px solid #aebbd0;
  border-radius: 50%;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
  cursor: help;
}

.table-help-mark:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.ui-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.record-evaluation-header,
.record-evaluation-cell {
  text-align: center;
}

.record-evaluation-status {
  display: inline-flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: help;
}

.record-evaluation-status.normal {
  border-color: #a7dfbc;
  background: #eaf8ef;
  color: #15803d;
}

.record-evaluation-status.problem {
  border-color: #f3b6b6;
  background: #fff0f0;
  color: #c62828;
}

.record-evaluation-status.pending {
  border-color: #d5dce8;
  background: #f4f6f9;
  color: #718096;
}

.record-icon-button {
  display: inline-flex;
  width: 32px;
  height: 30px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd9ee;
  border-radius: 6px;
  background: #ffffff;
  color: var(--primary);
  cursor: pointer;
}

.record-curve-button {
  width: auto;
  min-width: 108px;
  padding: 0 10px;
  gap: 6px;
  white-space: nowrap;
  touch-action: manipulation;
}

.record-curve-button svg {
  flex: 0 0 auto;
}

.record-icon-button:hover {
  border-color: var(--primary);
  background: #eef5ff;
}

.record-icon-button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.record-batch-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-device-cell,
.record-order-cell,
.record-config-cell,
.record-identity-cell,
.record-time-cell,
.record-metric-cell {
  min-width: 0;
}

.record-device-cell strong,
.record-order-cell strong,
.record-config-cell strong,
.record-identity-cell strong,
.record-time-cell strong,
.record-metric-cell strong,
.record-issue strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-device-cell span,
.record-order-cell > span,
.record-config-cell span,
.record-identity-cell span,
.record-time-cell span,
.record-metric-cell span,
.record-issue > span {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-order-cell.linked strong {
  color: #0f6b3c;
}

.record-order-cell.unlinked strong,
.record-order-cell.muted span {
  color: var(--muted);
}

.record-link-text-button,
.record-link-actions button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  font-size: 12px;
}

.record-link-text-button {
  margin-top: 3px;
}

.record-link-actions {
  display: flex !important;
  gap: 9px;
}

.curve-order-context {
  display: flex;
  margin-top: 5px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.curve-order-context span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.curve-report-link {
  flex: 0 0 auto;
  padding: 5px 9px;
  text-decoration: none;
}

.record-issue strong {
  display: flex;
  align-items: center;
  gap: 5px;
}

.record-issue.alarm strong,
.record-issue.alarm > span {
  color: var(--bad);
}

.record-issue.ok strong {
  color: #0c7d43;
}

.record-issue.perfect strong {
  color: #0c7d43;
}

.record-issue.attention strong,
.record-issue.attention > span {
  color: #835600;
}

.record-empty-row {
  padding: 36px 16px !important;
  color: var(--muted);
  text-align: center;
}

.record-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.record-summary span {
  border-radius: 999px;
  padding: 4px 8px;
  background: #f4f7fb;
  color: var(--muted);
  font-size: 12px;
}

.group-editor {
  display: grid;
  grid-template-columns: minmax(150px, 1fr);
  min-width: 170px;
}

.group-editor select {
  min-width: 0;
  width: 100%;
  padding: 8px 9px;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.settings-layout > .panel {
  padding: 18px;
}

.settings-layout form button {
  margin-top: 14px;
}

.dingtalk-settings {
  margin-top: 16px;
}

.dingtalk-head,
.dingtalk-form-title,
.dingtalk-fieldset > div:first-child,
.dingtalk-robot-head,
.dingtalk-robot-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.dingtalk-head {
  align-items: flex-start;
  margin-bottom: 18px;
}

.dingtalk-head h2 {
  margin: 4px 0 6px;
}

.dingtalk-head p,
.dingtalk-form-title small,
.dingtalk-fieldset small,
.dingtalk-robot-meta,
.dingtalk-robot-status,
.dingtalk-form label > small {
  color: var(--muted);
}

#dingtalkRobotCount {
  border-radius: 999px;
  padding: 6px 10px;
  background: #eef5ff;
  color: var(--brand-dark);
  font-size: 12px;
  white-space: nowrap;
}

.dingtalk-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(380px, 1.1fr);
  gap: 16px;
  align-items: start;
}

.dingtalk-form {
  display: grid;
  gap: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #f8faff;
}

.dingtalk-form-title > div {
  display: grid;
  gap: 3px;
}

.toggle-row {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 7px;
  color: var(--ink);
}

.toggle-row input,
.dingtalk-events input,
.dingtalk-targets input {
  min-width: 0;
}

.dingtalk-fieldset {
  display: grid;
  gap: 9px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.dingtalk-targets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  max-height: 230px;
  overflow: auto;
}

.dingtalk-targets .check-row {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px;
  background: #ffffff;
}

.dingtalk-events {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dingtalk-events label {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
  background: #ffffff;
  color: var(--ink);
}

.dingtalk-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

.dingtalk-form-actions .primary {
  margin-top: 0;
}

.dingtalk-list {
  display: grid;
  gap: 10px;
}

.dingtalk-robot {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
}

.dingtalk-robot.disabled {
  background: #f7f8fa;
  opacity: 0.76;
}

.dingtalk-robot-head strong {
  font-size: 15px;
}

.dingtalk-robot-head .status {
  font-size: 12px;
}

.dingtalk-robot-meta {
  margin: 8px 0;
  font-size: 12px;
  line-height: 1.7;
}

.dingtalk-event-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 8px 0 10px;
}

.dingtalk-event-tags span {
  border-radius: 999px;
  padding: 3px 7px;
  background: #edf4ff;
  color: #315f9d;
  font-size: 11px;
}

.dingtalk-robot-status {
  margin: 0 0 10px;
  font-size: 12px;
}

.dingtalk-robot-status.failed {
  color: var(--bad);
}

.dingtalk-robot-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.dingtalk-robot-actions button {
  padding: 7px 9px;
}

.analysis-admin {
  display: grid;
  grid-template-columns: minmax(340px, 0.75fr) minmax(360px, 1.25fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 24px;
}

.analysis-form .section-head {
  margin-bottom: 14px;
}

.section-head.compact h2,
.analysis-report-head h2 {
  margin-bottom: 4px;
}

.cycle-options {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  min-height: 42px;
  align-items: center;
}

.analysis-scope-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: 220px;
}

.analysis-check-row span {
  display: grid;
  min-width: 0;
}

.analysis-check-row strong,
.analysis-check-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-check-row small {
  color: var(--muted);
}

.analysis-plan-list,
.analysis-report-list,
.analysis-issues,
.analysis-trend {
  display: grid;
  gap: 10px;
}

.analysis-plan {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.analysis-plan:last-child {
  border-bottom: 0;
}

.analysis-plan > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.analysis-plan .analysis-plan-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.analysis-plan-actions button {
  white-space: nowrap;
}

.analysis-plan small {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-report-head {
  align-items: end;
}

.analysis-report-head label {
  width: 150px;
}

.analysis-report {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--panel);
}

.analysis-report-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.analysis-report-header h3 {
  display: inline;
  margin: 0 0 0 8px;
}

.analysis-report-header p {
  margin: 7px 0 0;
  color: var(--muted);
}

.analysis-cycle {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eaf3ff;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 700;
}

.analysis-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 18px 0 12px;
  border-block: 1px solid var(--line);
}

.analysis-metric {
  display: grid;
  gap: 4px;
  padding: 13px 14px;
  border-right: 1px solid var(--line);
}

.analysis-metric:last-child {
  border-right: 0;
}

.analysis-metric span,
.analysis-metric small {
  color: var(--muted);
}

.analysis-metric strong {
  font-size: 24px;
}

.analysis-metric small {
  margin-left: 4px;
  font-size: 12px;
  font-weight: 400;
}

.analysis-extra-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  color: var(--muted);
  font-size: 13px;
}

.analysis-extra-metrics strong {
  color: var(--ink);
}

.analysis-summary {
  margin: 14px 0;
  color: var(--ink);
  line-height: 1.7;
}

.latent-risk {
  margin: 16px 0;
  padding: 14px;
  border: 1px solid #cdd8e5;
  border-left: 4px solid #3977b9;
  border-radius: 6px;
  background: #f7faff;
}

.latent-risk.unknown {
  border-color: #d4dbe4;
  border-left-color: #7a8796;
  background: #f8fafc;
}

.latent-risk.medium {
  border-color: #e4c47e;
  border-left-color: #b7791f;
  background: #fffaf0;
}

.latent-risk.high {
  border-color: #e6abab;
  border-left-color: #c53030;
  background: #fff7f7;
}

.latent-risk-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.latent-risk-head h4,
.latent-risk-head p {
  margin: 0;
}

.latent-risk-head p {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.6;
}

.latent-risk-badge {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: #dcecff;
  color: #245b91;
  font-size: 12px;
  font-weight: 700;
}

.latent-risk.unknown .latent-risk-badge {
  background: #e8edf2;
  color: #536171;
}

.latent-risk.medium .latent-risk-badge {
  background: #f9e8bd;
  color: #805612;
}

.latent-risk.high .latent-risk-badge {
  background: #f8d7d7;
  color: #9d2525;
}

.latent-comparison,
.latent-product-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--line);
}

.latent-product-metrics {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 12px 0;
}

.latent-comparison > div,
.latent-product-metrics > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px;
  background: var(--panel);
}

.latent-comparison span,
.latent-product-metrics span {
  color: var(--muted);
  font-size: 12px;
}

.latent-comparison strong,
.latent-product-metrics strong {
  overflow-wrap: anywhere;
}

.latent-details {
  margin-top: 12px;
  border-top: 1px solid rgba(106, 123, 143, 0.22);
  padding-top: 10px;
}

.latent-details summary {
  color: var(--brand-dark);
  cursor: pointer;
  font-weight: 700;
}

.latent-signals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.latent-signal {
  padding: 10px 11px;
  border: 1px solid #d4deea;
  border-radius: 6px;
  background: var(--panel);
}

.latent-signal.warning {
  border-color: #e1bf73;
}

.latent-signal.critical {
  border-color: #df9999;
}

.latent-signal > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.latent-signal > div span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

.latent-signal.warning > div span {
  color: #946716;
}

.latent-signal.critical > div span {
  color: #b22e2e;
}

.latent-signal p {
  margin: 7px 0 4px;
  line-height: 1.55;
}

.latent-signal small,
.latent-data-note,
.latent-no-signal {
  color: var(--muted);
}

.latent-data-note,
.latent-no-signal {
  margin: 12px 0;
}

.analysis-details {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.analysis-details summary {
  color: var(--brand-dark);
  cursor: pointer;
  font-weight: 700;
}

.analysis-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 16px;
}

.analysis-detail-grid h4 {
  margin: 0 0 10px;
}

.analysis-issue-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.analysis-issue-row small,
.analysis-trend-row small {
  color: var(--muted);
}

.analysis-trend-row {
  display: grid;
  grid-template-columns: 44px minmax(80px, 1fr) 80px;
  gap: 8px;
  align-items: center;
}

.analysis-trend-track {
  height: 8px;
  border-radius: 4px;
  background: #edf1f6;
  overflow: hidden;
}

.analysis-trend-track span {
  display: block;
  height: 100%;
  background: var(--brand);
}

.analysis-device-table {
  margin-top: 16px;
}

.analysis-device-table table {
  min-width: 520px;
}

.analysis-report footer {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.analysis-empty {
  color: var(--muted);
}

.group-list {
  display: grid;
  gap: 10px;
}

.group-item {
  display: grid;
  grid-template-columns: minmax(210px, 1.1fr) minmax(170px, 0.9fr) 150px auto auto;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.group-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.group-item input,
.group-item select {
  width: 100%;
  min-width: 0;
}

.group-name-field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: calc((var(--group-depth, 1) - 1) * 22px);
}

.group-level-badge {
  flex: 0 0 auto;
  border-radius: 4px;
  background: #eef4ff;
  color: #2563c7;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 6px;
}

.group-item > span {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.scanner-settings {
  margin-top: 18px;
}

.scanner-view .scanner-settings {
  margin-top: 0;
}

.scanner-settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.scanner-model-section {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.scanner-coding-section {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.scanner-coding-section h3 {
  margin: 0 0 8px;
}

.serial-rule-fields {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.serial-rule-list,
.serial-batch-list {
  max-height: 310px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.serial-rule-row,
.serial-batch-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 90px auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.serial-batch-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.serial-rule-row:last-child,
.serial-batch-row:last-child {
  border-bottom: 0;
}

.serial-rule-row div,
.serial-batch-row div,
.serial-registry-table td {
  min-width: 0;
}

.serial-rule-row small,
.serial-batch-row small,
.serial-registry-table small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.serial-rule-row input {
  width: 90px;
  min-width: 0;
}

.serial-batch-section,
.serial-registry-section {
  padding-top: 12px;
}

.serial-registry-head,
.serial-registry-filters {
  display: flex;
  align-items: center;
  gap: 10px;
}

.serial-registry-head {
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.serial-registry-filters {
  display: grid;
  grid-template-columns: 140px 180px 140px minmax(180px, 1fr) auto;
  margin-bottom: 10px;
}

.serial-registry-table-wrap {
  max-height: 570px;
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.serial-registry-table-wrap:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.serial-registry-filters > * {
  min-width: 0;
  max-width: 100%;
}

.serial-registry-section > .pagination {
  flex-wrap: wrap;
}

.serial-registry-table {
  min-width: 880px;
  table-layout: fixed;
}

.serial-registry-table:has(.empty-table) {
  min-width: 0;
}

.serial-registry-table:has(.empty-table) thead {
  display: none;
}

.serial-registry-table th:nth-child(1) { width: 20%; }
.serial-registry-table th:nth-child(2) { width: 30%; }
.serial-registry-table th:nth-child(3) { width: 10%; }
.serial-registry-table th:nth-child(4) { width: 20%; }
.serial-registry-table th:nth-child(5),
.serial-registry-table th:nth-child(6) { width: 10%; }

.serial-registry-table th,
.serial-registry-table td {
  padding: 8px 10px;
  vertical-align: middle;
}

.serial-registry-table code {
  display: block;
  color: var(--text);
  font-weight: 700;
}

.serial-registry-table code,
.serial-registry-table small {
  white-space: normal;
  overflow-wrap: anywhere;
  overflow: visible;
  text-overflow: clip;
}

.serial-status {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 2px 7px;
  border-radius: 6px;
  background: #edf1f7;
  color: #536171;
  font-size: 12px;
  white-space: nowrap;
}

.serial-status-unused { background: #eef4ff; color: #1558b0; }
.serial-status-approved { background: #fff3cd; color: #805b00; }
.serial-status-running { background: #e5f7ec; color: #157347; }
.serial-status-passed { background: #dff5e8; color: #0f6b3c; }
.serial-status-failed { background: #fde7e7; color: #b42318; }
.serial-status-cancelled,
.serial-status-void { background: #edf0f4; color: #667085; }

.compact-pagination {
  justify-content: flex-end;
  margin-top: 10px;
}

@media (max-width: 900px) {
  .serial-rule-fields,
  .serial-registry-filters {
    grid-template-columns: 1fr 1fr;
  }

  .serial-registry-filters input {
    grid-column: 1 / -1;
  }
}

.record-publication-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 260px)) minmax(220px, 1fr);
  gap: 10px;
  align-items: stretch;
  margin: 10px 0;
}

.record-publication-summary > div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid #64748b;
  border-radius: 6px;
  background: #fff;
}

.record-publication-summary > div.public { border-left-color: #159455; }
.record-publication-summary strong { grid-row: span 2; font-size: 22px; }
.record-publication-summary small,
.record-publication-summary p { color: var(--muted); }
.record-publication-summary p { align-self: center; margin: 0; font-size: 12px; }

.record-publication-cell strong,
.record-publication-cell span { display: block; white-space: nowrap; }
.record-publication-cell strong { color: #9a6700; }
.record-publication-cell.published strong { color: #118447; }
.record-publication-cell span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.record-publication-cell button {
  margin-top: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand);
}

.record-publication-dialog { width: min(760px, calc(100vw - 24px)); }
.record-publication-timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}
.record-publication-timeline span {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
}
.record-publication-timeline span b { display: block; margin-top: 3px; color: inherit; }
.record-publication-timeline span.done { border-color: #9fd7ba; background: #effaf4; color: #118447; }
.record-publication-timeline span.current { border-color: #efc766; background: #fff9e9; color: #8a5b00; }
.record-publication-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.record-publication-form label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.record-publication-form label:has(textarea),
.record-publication-form .check-row,
.record-publication-form button,
.record-publication-readonly { grid-column: 1 / -1; }
.record-publication-form input,
.record-publication-form textarea { width: 100%; }
.record-publication-form textarea { min-height: 82px; resize: vertical; }
.record-publication-form button { justify-self: start; }
.record-publication-readonly { margin: 0; padding: 14px; border-radius: 6px; background: #f5f7fa; color: var(--muted); }

@media (max-width: 600px) {
  .record-publication-summary,
  .record-publication-form,
  .record-publication-timeline { grid-template-columns: 1fr; }
}

.customer-order-actions,
.customer-order-editor-head,
.customer-order-editor-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.customer-order-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.customer-order-summary article {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.customer-order-summary span,
.customer-order-summary strong {
  display: block;
}

.customer-order-summary span {
  color: var(--muted);
  font-size: 12px;
}

.customer-order-summary strong {
  margin-top: 4px;
  font-size: 22px;
}

.customer-portal-admin-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid #cad7e7;
  border-radius: 7px;
  background: #f4f8fd;
}

.customer-portal-admin-summary[hidden] { display: none; }
.customer-portal-admin-summary > div:first-child { display: grid; gap: 3px; margin-right: auto; }
.customer-portal-admin-summary span,
.customer-portal-admin-summary small { color: var(--muted); font-size: 12px; }
.customer-integration-status { display: grid; gap: 3px; }

.customer-portal-account-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 16px;
  align-items: center;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #cad7e7;
  border-radius: 7px;
  background: #f7faff;
}

.customer-portal-account-card p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.customer-portal-account-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.customer-portal-account-actions a { color: var(--primary); font-weight: 700; }

.customer-credential-once {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px;
  border-left: 3px solid #d39e00;
  background: #fff9e8;
}

.customer-credential-once span {
  padding: 5px 8px;
  border-radius: 5px;
  background: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.customer-order-toolbar {
  margin-bottom: 12px;
}

.customer-order-toolbar input {
  min-width: 280px;
}

.customer-order-layout {
  display: grid;
  grid-template-columns: minmax(300px, .65fr) minmax(540px, 1.35fr);
  gap: 14px;
  align-items: start;
}

.customer-order-directory,
.customer-order-editor {
  padding: 0;
  overflow: hidden;
}

.customer-order-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.customer-order-tabs button {
  border: 0;
  border-right: 1px solid var(--line);
  padding: 10px 6px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
}

.customer-order-tabs button:last-child {
  border-right: 0;
}

.customer-order-tabs button.selected {
  background: #fff;
  color: var(--brand);
  box-shadow: inset 0 -3px 0 var(--brand);
  font-weight: 700;
}

.customer-order-list {
  max-height: 650px;
  overflow: auto;
}

.customer-order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.customer-order-row:hover,
.customer-order-row.selected {
  background: #f2f7fe;
}

.customer-order-row.selected {
  box-shadow: inset 3px 0 0 var(--brand);
}

.customer-order-row strong,
.customer-order-row small {
  display: block;
}

.customer-order-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.customer-order-import-form,
.customer-quick-form,
.customer-order-detail,
.customer-detail-form,
.customer-order-readonly,
.customer-order-draft-form {
  padding: 16px;
}

.customer-order-import-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, .55fr) auto;
  gap: 10px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.customer-order-import-form > div {
  grid-column: 1 / -1;
}

.customer-order-import-form h2,
.customer-order-editor-head h2 {
  margin: 0;
}

.customer-order-import-form p,
.customer-order-editor-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.customer-order-field-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.customer-order-reparse-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, auto) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin: 10px 0;
  border: 1px solid #86b7fe;
  border-radius: 6px;
  background: #f3f8ff;
}

.customer-order-reparse-preview p {
  margin: 3px 0 0;
  color: #52637a;
}

@media (max-width: 640px) {
  .customer-order-reparse-preview {
    grid-template-columns: 1fr;
  }
}

.customer-quick-form,
.customer-detail-form,
.customer-order-draft-form {
  display: grid;
  gap: 12px;
}

.customer-order-empty {
  padding: 44px 20px;
  color: var(--muted);
  text-align: center;
}

.customer-order-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.customer-match-field {
  grid-column: span 3;
}

.customer-order-security-note,
.customer-order-erp-note {
  padding: 9px 11px;
  border-left: 3px solid var(--brand);
  background: #f2f7fe;
  color: #43516a;
  font-size: 12px;
}

.customer-order-lines {
  display: grid;
  gap: 8px;
}

.customer-order-line {
  display: grid;
  grid-template-columns: 28px 1.2fr 1fr 1fr 90px 110px 34px;
  gap: 8px;
  align-items: end;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.customer-order-line-number {
  display: grid;
  place-items: center;
  width: 26px;
  height: 34px;
  color: var(--muted);
  font-weight: 700;
}

.customer-order-product-state {
  align-self: center;
  padding: 5px 7px;
  border-radius: 4px;
  background: #fff7db;
  color: #986c00;
  font-size: 11px;
  text-align: center;
}

.customer-order-product-state.matched,
.customer-order-lines.readonly em.matched {
  background: #eaf8ef;
  color: #18743b;
}

.customer-order-lines.readonly > div {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px;
  border-bottom: 1px solid var(--line);
}

.customer-order-lines.readonly span {
  color: var(--muted);
}

.customer-order-lines.readonly em {
  padding: 4px 7px;
  border-radius: 4px;
  background: #fff7db;
  color: #986c00;
  font-size: 11px;
  font-style: normal;
}

.customer-order-editor-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

@media (max-width: 1100px) {
  .customer-order-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .customer-order-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .customer-order-summary,
  .customer-order-form-grid,
  .customer-order-import-form {
    grid-template-columns: 1fr;
  }

  .customer-order-toolbar input {
    min-width: 0;
  }

  .customer-portal-admin-summary,
  .customer-portal-account-card {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .customer-portal-account-actions { justify-content: flex-start; }

  .customer-match-field {
    grid-column: auto;
  }

  .customer-order-line {
    grid-template-columns: 28px 1fr 34px;
  }

  .customer-order-line label,
  .customer-order-product-state {
    grid-column: 2 / 3;
  }

  .customer-order-line .icon-button {
    grid-column: 3;
    grid-row: 1;
  }

  .customer-order-lines.readonly > div {
    grid-template-columns: 1fr;
  }
}

.assistant-heading,
.assistant-panel-head,
.assistant-compose-actions,
.assistant-plan-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.assistant-heading { margin-bottom: 14px; }
.assistant-heading h2,
.assistant-panel-head h3 { margin: 2px 0 4px; }
.assistant-heading p,
.assistant-panel-head small,
.assistant-compose-actions small { margin: 0; color: var(--muted); }

.assistant-safety-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.assistant-safety-badges span,
.assistant-plan-status {
  padding: 5px 8px;
  border-radius: 6px;
  background: #edf5ff;
  color: #1559a8;
  font-size: 12px;
  font-weight: 700;
}

.assistant-layout {
  display: grid;
  grid-template-columns: minmax(360px, .85fr) minmax(480px, 1.15fr);
  gap: 14px;
  align-items: start;
}

.assistant-conversation-panel,
.assistant-plan-panel { padding: 16px; }
.assistant-plan-panel { position: sticky; top: 12px; }

.assistant-messages {
  height: 330px;
  margin: 14px 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7f9fc;
}

.assistant-message {
  max-width: 88%;
  margin-bottom: 10px;
  padding: 9px 11px;
  border: 1px solid #d7e1ee;
  border-radius: 7px;
  background: #fff;
}

.assistant-message.user { margin-left: auto; border-color: #9bc0f2; background: #edf5ff; }
.assistant-message strong { color: var(--muted); font-size: 11px; }
.assistant-message p { margin: 4px 0 0; white-space: pre-wrap; line-height: 1.5; }
.assistant-message-form textarea,
.assistant-wizard textarea,
.assistant-wizard input,
.assistant-wizard select { width: 100%; }
.assistant-compose-actions { margin-top: 8px; }

.assistant-wizard {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.assistant-wizard summary { color: var(--brand); font-weight: 700; cursor: pointer; }
.assistant-wizard form { margin-top: 12px; }
.assistant-wizard-fields { margin: 10px 0; }
.assistant-config-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.assistant-empty { padding: 28px 14px; color: var(--muted); text-align: center; }
.assistant-plan-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}
.assistant-plan-summary div { padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: #f7f9fc; }
.assistant-plan-summary span,
.assistant-plan-summary strong { display: block; }
.assistant-plan-summary span { color: var(--muted); font-size: 11px; }
.assistant-plan-summary strong { margin-top: 3px; font-size: 16px; }

.assistant-step { margin-bottom: 12px; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.assistant-step > header,
.assistant-step > footer {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 9px 11px;
  background: #f4f7fb;
}
.assistant-step > header strong { flex: 1; }
.assistant-step > header em { color: #9a5d00; font-style: normal; font-weight: 800; }
.assistant-step > footer { color: var(--muted); font-size: 11px; }

.assistant-diff-columns { display: grid; grid-template-columns: 1fr 1fr; }
.assistant-diff-columns section { min-width: 0; padding: 10px; }
.assistant-diff-columns section + section { border-left: 1px solid var(--line); }
.assistant-diff-columns h4 { margin: 0 0 8px; }
.assistant-diff-columns pre { max-height: 220px; margin: 0; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11px; }

.assistant-device-before,
.assistant-result {
  display: grid;
  grid-template-columns: minmax(90px, .6fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}
.assistant-device-current + .assistant-device-current { margin-top: 8px; }
.assistant-change-list { display: grid; gap: 5px; margin-top: 6px; }
.assistant-change-list div {
  display: grid;
  grid-template-columns: minmax(74px, 1fr) auto auto auto;
  gap: 7px;
  align-items: center;
  padding: 6px;
  border-radius: 5px;
  background: #fff7e6;
  font-size: 11px;
}
.assistant-change-list b { color: #a66a00; }
.assistant-no-change { display: block; padding: 6px 0; color: var(--muted); }
.assistant-config-diff { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.assistant-config-diff div { padding: 6px; border-radius: 5px; background: #f2f7fe; }
.assistant-config-diff span,
.assistant-config-diff strong { display: block; font-size: 11px; }

.assistant-confirm-form {
  display: grid;
  gap: 9px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.assistant-confirm-form input[type="password"] { width: 100%; max-width: 360px; }
.assistant-results h4 { margin-bottom: 4px; }
.assistant-result.success { color: #18743b; }
.assistant-result.awaiting_ack { color: #9a6500; }
.assistant-result.failed { color: #c83030; }

@media (max-width: 1000px) {
  .assistant-layout { grid-template-columns: 1fr; }
  .assistant-plan-panel { position: static; }
}

@media (max-width: 560px) {
  .assistant-heading,
  .assistant-panel-head,
  .assistant-compose-actions,
  .assistant-plan-actions { align-items: stretch; flex-direction: column; }
  .assistant-safety-badges { justify-content: flex-start; }
  .assistant-layout { display: block; }
  .assistant-plan-panel { margin-top: 12px; }
  .assistant-messages { height: 280px; }
  .assistant-message { max-width: 96%; }
  .assistant-config-grid,
  .assistant-plan-summary,
  .assistant-diff-columns,
  .assistant-config-diff { grid-template-columns: 1fr; }
  .assistant-diff-columns section + section { border-top: 1px solid var(--line); border-left: 0; }
}

/* Independent multi-point temperature test module */
.multipoint-view [hidden] { display: none !important; }
#multiPointWorkflowMessage:empty { display: none; }
.mp-workspace-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.mp-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); }
.mp-tabs button { background: transparent; border: 0; border-radius: 0; color: var(--muted); padding: 12px; border-bottom: 3px solid transparent; }
.mp-tabs button[aria-pressed="true"] { color: var(--brand); border-bottom-color: var(--brand); font-weight: 700; }
.mp-device-directory { margin: 12px 0 18px; }
.mp-device-directory summary, #multiPointSampleEditor > summary { cursor: pointer; padding: 10px 0; font-weight: 600; }
.mp-device-list, .mp-catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-bottom: 18px; }
.mp-device-list { max-height: 260px; overflow: auto; }
.mp-device-list article, .mp-catalog article { padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; min-width: 0; overflow-wrap: anywhere; }
.mp-device-list small, .mp-catalog small { display: block; color: var(--muted); margin: 4px 0; }
.mp-device-list p { font-size: 12px; margin: 6px 0 0; }
.mp-device-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; font-size: 12px; }
.mp-device-badges span { background: #f1f4f8; padding: 2px 5px; border-radius: 4px; }
.mp-catalog pre, .mp-create-summary pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; }
#multiPointTemplates.workflow-workspace { border: 0; border-radius: 0; padding: 0; background: transparent; }
#multiPointTemplates .workflow-setup-grid { grid-template-columns: minmax(0, 1fr); }
#multiPointTemplates .workflow-form + .workflow-form { border-left: 0; border-top: 1px solid var(--line); }
.mp-create-dialog { width: min(760px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); }
.mp-create-dialog::backdrop { background: rgb(15 23 42 / 45%); }
.mp-create-dialog .multipoint-form { position: static; padding: 20px; }
.mp-create-dialog h3 { margin: 18px 0 0; font-size: 14px; }
.mp-create-summary { padding: 12px; background: #f5f8fc; border-radius: 5px; font-size: 13px; overflow-wrap: anywhere; }
.mp-create-summary dl { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px; margin: 0; }
.mp-create-summary dd { margin: 0; }
.mp-confirm { display: flex; gap: 8px; align-items: flex-start; }
.multipoint-form .mp-confirm input { width: auto; flex: 0 0 auto; margin-top: 3px; }
.multipoint-view .multipoint-detail, .multipoint-view .workflow-task-detail { overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .mp-workspace-head { align-items: stretch; flex-direction: column; }
  .mp-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mp-tabs button { padding: 10px 6px; }
  .mp-create-dialog .multipoint-form { padding: 12px; }
  .mp-create-dialog .form-row { grid-template-columns: minmax(0, 1fr); }
  .mp-create-summary dl { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .mp-create-summary dd { margin-bottom: 8px; }
  .multipoint-view .multipoint-toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .multipoint-view .multipoint-toolbar label { min-width: 0; }
  .multipoint-view .multipoint-toolbar input, .multipoint-view .multipoint-toolbar select { width: 100%; min-width: 0; }
}
.multipoint-view {
  padding-bottom: 40px;
}

.workflow-workspace {
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid #bfd4f4;
  border-top: 4px solid #1769d2;
  border-radius: 7px;
  background: #f7faff;
}

.workflow-head,
.workflow-directory-head,
.workflow-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.workflow-head h2,
.workflow-head p,
.workflow-directory-head h3,
.workflow-directory-head p,
.workflow-detail-head h2,
.workflow-detail-head p {
  margin: 3px 0;
}

.workflow-head p,
.workflow-directory-head p,
.workflow-detail-head p {
  color: var(--muted);
  font-size: 12px;
}

.workflow-head-actions,
.workflow-control-fields,
.workflow-upload {
  display: flex;
  gap: 8px;
  align-items: center;
}

.workflow-sim-badge {
  padding: 5px 9px;
  border: 1px solid #f5cf72;
  border-radius: 999px;
  background: #fff8e5;
  color: #8a5700;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.workflow-setup {
  margin-top: 10px;
  padding: 0;
  overflow: hidden;
}

.workflow-setup > summary {
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}

.workflow-setup > summary span {
  color: var(--muted);
  font-size: 12px;
}

.workflow-setup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.workflow-setup-grid > .workflow-form:nth-child(3) {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  border-left: 0;
}

.workflow-form {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 14px;
}

.workflow-form + .workflow-form {
  border-left: 1px solid var(--line);
}

.workflow-form h3 {
  margin: 0 0 2px;
}

.workflow-form label,
.workflow-form input,
.workflow-form select,
.workflow-form textarea {
  min-width: 0;
  width: 100%;
}

.workflow-number-grid,
.workflow-gear-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.workflow-gear-grid {
  grid-template-columns: 1.2fr .8fr .8fr;
}

.workflow-stage-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 4px;
}

.workflow-stage-toolbar > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.workflow-stage-toolbar > div {
  display: flex;
  gap: 6px;
}

.workflow-stage-list {
  display: grid;
  gap: 8px;
  max-height: 620px;
  overflow-y: auto;
  padding-right: 3px;
}

.workflow-stage-editor {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fbff;
}

.workflow-stage-editor > header,
.workflow-stage-editor > header > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}

.workflow-stage-editor > header span {
  color: var(--muted);
  font-size: 11px;
}

.workflow-stage-actions button {
  min-height: 28px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--primary);
}

.workflow-stage-actions button:disabled {
  color: #9aa6b6;
  cursor: not-allowed;
}

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

.workflow-stage-prompt {
  grid-column: span 3;
}

.workflow-timer-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px dashed #c7d7ec;
}

.workflow-stage-editor input,
.workflow-stage-editor select {
  padding: 7px 6px;
}

.workflow-task-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.workflow-task-form {
  display: grid;
  gap: 9px;
  padding: 14px;
}

.workflow-task-form h3 {
  margin: 0;
}

.workflow-task-directory {
  padding: 12px;
  min-width: 0;
}

.workflow-task-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  max-height: 260px;
  margin-top: 8px;
  overflow: auto;
}

.workflow-task-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.workflow-task-item:hover,
.workflow-task-item.selected {
  border-color: #73a6ec;
  background: #eef6ff;
}

.workflow-task-item span,
.workflow-task-item strong,
.workflow-task-item small,
.workflow-task-item b {
  display: block;
  min-width: 0;
}

.workflow-task-item strong,
.workflow-task-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-task-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.workflow-task-detail {
  margin-top: 12px;
  padding: 16px;
  overflow: hidden;
}

.workflow-status {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: #475569;
  font-size: 11px;
  white-space: nowrap;
}

.workflow-status.ready,
.workflow-status.waiting_operator { background: #fff4d6; color: #8a5700; }
.workflow-status.stage_running { background: #e8f7ef; color: #087a3d; }
.workflow-status.completed,
.workflow-status.review_pending { background: #eaf2ff; color: #1758b3; }
.workflow-status.approved { background: #e8f7ef; color: #087a3d; }
.workflow-status.rejected,
.workflow-status.aborted { background: #feeceb; color: #b42318; }

.workflow-stat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(100px, 1fr));
  gap: 7px;
  margin: 12px 0;
}

.workflow-stat-grid article,
.workflow-stage-strip article,
.workflow-probe {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.workflow-stat-grid span,
.workflow-stat-grid strong,
.workflow-stat-grid small,
.workflow-stage-strip span,
.workflow-stage-strip strong,
.workflow-stage-strip small,
.workflow-stage-strip b,
.workflow-probe span,
.workflow-probe strong,
.workflow-probe small {
  display: block;
}

.workflow-stat-grid span,
.workflow-stat-grid small,
.workflow-stage-strip span,
.workflow-stage-strip small,
.workflow-probe span,
.workflow-probe small {
  color: var(--muted);
  font-size: 11px;
}

.workflow-controls {
  padding: 10px;
  border: 1px solid #bfd4f4;
  border-radius: 6px;
  background: #eef6ff;
}

.workflow-control-fields {
  display: grid;
  grid-template-columns: 100px 110px 110px minmax(180px, 1fr);
  margin-bottom: 8px;
}

.workflow-stage-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.workflow-stage-strip article.completed { border-left: 4px solid var(--ok); }
.workflow-stage-strip article.running,
.workflow-stage-strip article.current { border-left: 4px solid #1769d2; background: #eef6ff; }
.workflow-stage-strip article.aborted { border-left: 4px solid var(--bad); }

.workflow-probe-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(72px, 1fr));
  gap: 6px;
}

.workflow-probe.inactive { background: #f1f5f9; opacity: .7; }
.workflow-probe.environment { border-color: #8dd5c3; background: #edfbf6; }

.workflow-detail-grid,
.workflow-assets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.workflow-timeline,
.workflow-anomalies,
.workflow-raw-list {
  display: grid;
  gap: 5px;
}

.workflow-timeline > div,
.workflow-anomalies > div {
  display: grid;
  grid-template-columns: 130px minmax(120px, .8fr) minmax(0, 1fr);
  gap: 8px;
  padding: 8px;
  border-left: 3px solid #73a6ec;
  background: #f8fafc;
  font-size: 12px;
}

.workflow-raw-list > div {
  display: grid;
  grid-template-columns: 130px 120px minmax(0, 1fr);
  gap: 8px;
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.workflow-raw-list time,
.workflow-raw-list span { color: var(--muted); }

.workflow-timeline > div.waiting { border-left-color: #e0a000; background: #fffaf0; }
.workflow-timeline time,
.workflow-anomalies time,
.workflow-timeline span,
.workflow-anomalies small { color: var(--muted); }

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

.workflow-image-grid figure { margin: 0; }
.workflow-image-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 5px; }
.workflow-image-grid figcaption { margin-top: 3px; font-size: 11px; color: var(--muted); }

@media (max-width: 1280px) {
  .workflow-setup-grid { grid-template-columns: 1fr; }
  .workflow-form + .workflow-form { border-left: 0; border-top: 1px solid var(--line); }
  .workflow-stat-grid { grid-template-columns: repeat(3, 1fr); }
  .workflow-probe-grid { grid-template-columns: repeat(6, 1fr); }
}

@media (max-width: 760px) {
  .workflow-head,
  .workflow-detail-head { flex-direction: column; }
  .workflow-task-layout,
  .workflow-detail-grid,
  .workflow-assets { grid-template-columns: 1fr; }
  .workflow-task-list { grid-template-columns: 1fr; }
  .workflow-number-grid { grid-template-columns: repeat(2, 1fr); }
  .workflow-stage-toolbar { align-items: flex-start; flex-direction: column; }
  .workflow-stage-fields,
  .workflow-timer-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workflow-stage-prompt { grid-column: span 2; }
  .workflow-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .workflow-stage-strip { grid-template-columns: 1fr; }
  .workflow-probe-grid { grid-template-columns: repeat(3, 1fr); }
  .workflow-control-fields { grid-template-columns: repeat(2, 1fr); }
  .workflow-timeline > div,
  .workflow-anomalies > div,
  .workflow-raw-list > div { grid-template-columns: 1fr; }
}

.multipoint-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(100px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.multipoint-summary-card {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid #94a3b8;
  border-radius: 7px;
  background: #fff;
}

.multipoint-summary-card span,
.multipoint-summary-card strong {
  display: block;
}

.multipoint-summary-card span {
  color: var(--muted);
  font-size: 12px;
}

.multipoint-summary-card strong {
  margin-top: 3px;
  font-size: 22px;
}

.multipoint-summary-card.running { border-left-color: var(--ok); }
.multipoint-summary-card.waiting { border-left-color: var(--warn); }
.multipoint-summary-card.ended { border-left-color: var(--brand); }
.multipoint-summary-card.abnormal { border-left-color: var(--bad); }

.multipoint-notice {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 7px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 12px;
  line-height: 1.5;
}

.multipoint-notice.development {
  border-color: #f5cf72;
  background: #fff8e5;
  color: #8a5700;
}

.multipoint-notice.readonly {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1e40af;
}

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

.multipoint-form {
  position: sticky;
  top: 14px;
  display: grid;
  gap: 10px;
  padding: 16px;
}

.multipoint-form .section-head {
  margin: 0 0 2px;
}

.multipoint-form label,
.multipoint-form input,
.multipoint-form select,
.multipoint-form textarea {
  width: 100%;
}

.multipoint-main {
  min-width: 0;
}

.multipoint-toolbar {
  margin-bottom: 10px;
}

.multipoint-table-wrap {
  max-height: 420px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.multipoint-table {
  min-width: 920px;
}

.multipoint-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.multipoint-table tr.selected td {
  background: #eff6ff;
}

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

.multipoint-table td small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.multipoint-status {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
}

.multipoint-status.starting,
.multipoint-status.stopping { background: #fff4d6; color: #8a5700; }
.multipoint-status.running { background: #e8f7ef; color: #087a3d; }
.multipoint-status.ended { background: #eaf2ff; color: #1758b3; }
.multipoint-status.abnormal { background: #feeceb; color: #b42318; }

.multipoint-detail {
  margin-top: 12px;
  padding: 16px;
  overflow: hidden;
}

.multipoint-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.multipoint-detail-head h2,
.multipoint-detail-head p {
  margin: 3px 0;
}

.multipoint-detail-head p {
  color: var(--muted);
  font-size: 12px;
}

.multipoint-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(100px, 1fr)) minmax(190px, 1.4fr);
  gap: 8px;
  margin: 10px 0;
}

.multipoint-stat-grid article {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.multipoint-stat-grid span,
.multipoint-stat-grid strong,
.multipoint-stat-grid small {
  display: block;
}

.multipoint-stat-grid span,
.multipoint-stat-grid small {
  color: var(--muted);
  font-size: 11px;
}

.multipoint-stat-grid strong {
  margin: 3px 0;
}

.result-pass { color: var(--ok); }
.result-fail,
.result-no-data { color: var(--bad); }
.result-statistics-only { color: #9a6700; }

.multipoint-summary-text {
  padding: 10px 12px;
  border-left: 3px solid var(--brand);
  background: #f4f8fe;
}

.multipoint-summary-text p {
  margin: 4px 0 0;
  color: #334155;
  line-height: 1.55;
}

.multipoint-curve {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.multipoint-curve.empty {
  color: var(--muted);
  text-align: center;
}

.multipoint-curve-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

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

.multipoint-curve svg {
  display: block;
  width: 100%;
  min-width: 600px;
  height: auto;
}

.multipoint-curve-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.multipoint-curve-scroll:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.multipoint-curve svg .grid line {
  stroke: #dbe5f1;
  stroke-width: .7;
}

.multipoint-curve svg text {
  fill: #64748b;
  font-size: 9px;
}

.multipoint-curve svg .series path {
  fill: none;
  stroke-width: 1.25;
  vector-effect: non-scaling-stroke;
}

.multipoint-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
}

.multipoint-legend span {
  font-size: 10px;
  color: #475569;
}

.multipoint-legend span::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 4px;
  border-radius: 50%;
  background: var(--probe-color);
}

.multipoint-probe-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(72px, 1fr));
  gap: 7px;
}

.multipoint-probe {
  padding: 8px;
  border: 1px solid #bbdec9;
  border-radius: 6px;
  background: #f0faf4;
}

.multipoint-probe span,
.multipoint-probe strong,
.multipoint-probe small {
  display: block;
}

.multipoint-probe span,
.multipoint-probe small { color: var(--muted); font-size: 10px; }
.multipoint-probe.fail { border-color: #f0b9b6; background: #fef2f2; }
.multipoint-probe.inactive { border-color: var(--line); background: #f8fafc; opacity: .68; }

.multipoint-disclosure {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.multipoint-disclosure summary {
  cursor: pointer;
  padding: 10px 12px;
  font-weight: 700;
}

.multipoint-disclosure pre {
  max-height: 260px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  border-top: 1px solid var(--line);
  background: #f8fafc;
  font-size: 11px;
}

.multipoint-raw-list {
  max-height: 300px;
  overflow: auto;
  border-top: 1px solid var(--line);
}

.multipoint-raw-list > div {
  display: grid;
  grid-template-columns: 145px 80px minmax(0, 1fr);
  gap: 10px;
  padding: 7px 12px;
  border-bottom: 1px solid #edf1f6;
  font-size: 11px;
}

.multipoint-raw-list time,
.multipoint-raw-list span { color: var(--muted); }

.multipoint-simulator {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #f5cf72;
  border-radius: 7px;
  background: #fff8e5;
  color: #784d00;
}

.multipoint-simulator p { margin: 3px 0 8px; font-size: 11px; }

.multipoint-assets {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(240px, .7fr);
  gap: 16px;
  margin-top: 14px;
}

.multipoint-image-upload {
  display: grid;
  grid-template-columns: 100px minmax(140px, 1fr) auto;
  gap: 7px;
}

.multipoint-image-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.multipoint-image-grid figure {
  margin: 0;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.multipoint-image-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.multipoint-image-grid figcaption {
  margin: 5px 0;
  color: var(--muted);
  font-size: 10px;
}

.multipoint-report-list {
  display: grid;
  gap: 7px;
}

.multipoint-report-list a {
  display: grid;
  gap: 2px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--brand);
  text-decoration: none;
}

.multipoint-report-list span { color: var(--muted); font-size: 10px; }

@media (max-width: 1280px) {
  .multipoint-layout { grid-template-columns: 1fr; }
  .multipoint-form { position: static; }
  .multipoint-probe-grid { grid-template-columns: repeat(6, minmax(72px, 1fr)); }
  .multipoint-stat-grid { grid-template-columns: repeat(3, minmax(100px, 1fr)); }
}

@media (max-width: 760px) {
  .multipoint-summary { grid-template-columns: repeat(2, 1fr); }
  .multipoint-probe-grid { grid-template-columns: repeat(3, 1fr); }
  .multipoint-assets { grid-template-columns: 1fr; }
  .multipoint-image-grid { grid-template-columns: repeat(2, 1fr); }
  .multipoint-image-upload { grid-template-columns: 1fr; }
  .multipoint-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .multipoint-detail-head { display: block; }
}

@media (max-width: 600px) {
  .serial-rule-fields,
  .serial-registry-filters {
    grid-template-columns: 1fr;
  }

  .serial-rule-row,
  .serial-batch-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .serial-rule-row input,
  .serial-rule-row button,
  .serial-batch-row a {
    grid-column: 2;
  }
}

.scanner-editor {
  min-width: 0;
  padding: 14px 0;
}

.scanner-editor h3 {
  margin: 0 0 12px;
}

.scanner-editor > p {
  color: var(--muted);
}

.scanner-parameter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.scanner-config-list,
.scanner-model-list,
.scanner-group-config-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.scanner-config-row,
.scanner-model-row,
.scanner-group-row {
  display: grid;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}

.scanner-config-row:last-child,
.scanner-model-row:last-child,
.scanner-group-row:last-child {
  border-bottom: 0;
}

.scanner-config-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.scanner-config-row div:first-child,
.scanner-group-row > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.scanner-config-row small,
.scanner-model-row small,
.scanner-group-row small {
  color: var(--muted);
}

.scanner-model-row {
  grid-template-columns: auto minmax(100px, 0.7fr) minmax(120px, 1fr) minmax(160px, 1.4fr) auto;
}

.scanner-model-row.is-disabled {
  opacity: 0.62;
  background: #f7f8fa;
}

.scanner-group-row {
  grid-template-columns: minmax(140px, 0.6fr) minmax(240px, 1fr);
}

.scanner-component-badge,
.scanner-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #eef4ff;
  color: #1558b0;
  font-size: 12px;
}

.scanner-status-published,
.status-good {
  color: #087a45;
}

.scanner-status-disabled,
.status-warning {
  color: #ad5b00;
}

.scanner-row-actions {
  display: flex;
  gap: 6px;
}

@media (max-width: 900px) {
  .scanner-settings-grid,
  .scanner-parameter-grid {
    grid-template-columns: 1fr;
  }

  .scanner-model-row,
  .scanner-group-row {
    grid-template-columns: 1fr;
  }
}

.danger-button {
  color: var(--bad);
}

#devices table {
  min-width: 900px;
}

#devices th:nth-child(1),
#devices td:nth-child(1) {
  min-width: 120px;
}

.device-management-table {
  min-width: 1040px;
  table-layout: fixed;
}

.device-management-table th:nth-child(1) {
  width: 11%;
}

.device-management-table th:nth-child(2) {
  width: 13%;
}

.device-management-table th:nth-child(3) {
  width: 9%;
}

.device-management-table th:nth-child(4) {
  width: 13%;
}

.device-management-table th:nth-child(5) {
  width: 6%;
}

.device-management-table th:nth-child(6) {
  width: 9%;
}

.device-management-table th:nth-child(7) {
  width: 19%;
}

.device-management-table th:nth-child(8) {
  width: 14%;
}

.device-management-table th:nth-child(9) {
  width: 6%;
}

#devices th,
#devices td {
  padding: 7px 10px;
}

#devices td {
  height: 48px;
  min-width: 0;
  overflow: hidden;
  line-height: 1.25;
  text-overflow: ellipsis;
  font-size: 13px;
}

#devices td:nth-child(1),
#devices td:nth-child(3),
#devices td:nth-child(5),
#devices td:nth-child(6) {
  white-space: nowrap;
}

.device-firmware {
  display: grid;
  gap: 2px;
}

.device-firmware strong,
.device-firmware small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-firmware small {
  color: var(--muted);
  font-size: 11px;
}

.record-mode-snapshot {
  color: #52667f;
  font-size: 11px;
}

.device-table-wrap {
  max-height: calc(100vh - 250px);
  min-height: 320px;
}

.device-management-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
}

.device-management-table th:last-child,
.device-management-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 4;
  background: #ffffff;
  box-shadow: -8px 0 12px -12px rgba(18, 36, 65, 0.45);
  overflow: visible;
}

#devices .device-management-table td:last-child {
  overflow: visible;
}

#devices .device-actions {
  justify-content: flex-end;
  min-width: 0;
}

.device-management-table thead th:last-child {
  z-index: 7;
  background: #f7f9fc;
}

.device-management-table td:last-child:has(.device-action-menu[open]) {
  z-index: 30;
}

#devices .group-editor {
  grid-template-columns: minmax(120px, 1fr);
  min-width: 130px;
}

#devices .group-editor select {
  padding: 6px 8px;
}

.current-parameters {
  display: grid;
  gap: 2px;
  line-height: 1.25;
  white-space: nowrap;
}

.current-parameters span,
.current-parameters small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  font-size: 12px;
}

.device-record-summary {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  font-size: 12px;
}

.device-record-summary > strong {
  color: var(--ink);
}

.device-record-summary .record-pass {
  color: var(--ok);
}

.device-record-summary .record-fail {
  color: var(--bad);
}

.secondary-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #ffffff;
  color: var(--brand);
  cursor: pointer;
  white-space: nowrap;
}

.secondary-button:hover {
  border-color: var(--brand);
  background: #eaf3ff;
}

.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  background: #f4f7fb;
}

.config-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.config-template-manager {
  margin: 14px 0 16px;
  border-block: 1px solid var(--line);
  padding: 14px 0;
}

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

.config-template-head h3,
.config-template-head small {
  display: block;
  margin: 0;
}

.config-template-head h3 {
  font-size: 15px;
}

.config-template-head small,
.config-template-head > span {
  color: var(--muted);
  font-size: 12px;
}

.config-template-head small {
  margin-top: 3px;
}

.config-template-head > span {
  flex: 0 0 auto;
  font-weight: 700;
}

.config-template-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.config-template-fields select,
.config-template-fields input {
  width: 100%;
  min-width: 0;
}

.config-ai-guidance {
  display: grid;
  gap: 5px;
  margin-top: 10px;
}

.config-ai-guidance > span {
  color: #344258;
  font-size: 12px;
  font-weight: 700;
}

.config-ai-guidance textarea {
  width: 100%;
  min-height: 58px;
  resize: vertical;
}

.config-ai-guidance small {
  color: #6e7b8d;
  font-size: 11px;
}

.config-template-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.config-template-actions .ai-button:not(:disabled) {
  border-color: #168a62;
  background: #ecf9f3;
  color: #116646;
}

.config-template-locked .config-template-fields input[readonly],
.config-template-locked .form-grid input[readonly] {
  border-color: #d6dde8;
  background: #edf1f6;
  color: #647084;
  cursor: not-allowed;
  box-shadow: none;
}

.config-template-locked .form-grid label {
  color: #697588;
}

.config-template-locked .form-grid input[name="password"] {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
  cursor: text;
}

.config-template-manager .message {
  min-height: 18px;
  margin-bottom: 0;
}

.config-ai-recommendation {
  margin-top: 10px;
  border: 1px solid #bfd4f0;
  border-left: 4px solid #2f77d0;
  border-radius: 6px;
  padding: 12px;
  background: #f5f9ff;
}

.config-ai-recommendation[hidden] {
  display: none;
}

.config-ai-recommendation.changed {
  border-color: #9fc5ed;
  border-left-color: #1677d2;
  background: #f3f8ff;
}

.config-ai-recommendation.loaded {
  border-color: #89c7ae;
  border-left-color: #168a62;
  background: #f2fbf7;
}

.config-ai-recommendation.unchanged {
  border-color: #b5d9c8;
  border-left-color: #25835e;
  background: #f3faf7;
}

.config-ai-recommendation.empty {
  border-color: #d5dde8;
  border-left-color: #8b98a9;
  background: #f7f9fc;
}

.config-ai-recommendation-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.config-ai-recommendation-head > div {
  display: grid;
  gap: 2px;
}

.config-ai-recommendation-head strong {
  font-size: 14px;
}

.config-ai-recommendation-head small {
  color: var(--muted);
  font-size: 11px;
}

.config-ai-recommendation-head > span {
  flex: 0 0 auto;
  border-radius: 12px;
  padding: 3px 8px;
  background: #e5eef9;
  color: #315c8d;
  font-size: 11px;
  font-weight: 700;
}

.config-ai-recommendation.loaded .config-ai-recommendation-head > span,
.config-ai-recommendation.unchanged .config-ai-recommendation-head > span {
  background: #dff2e9;
  color: #176b4a;
}

.config-ai-recommendation > p {
  margin: 9px 0 0;
  color: #47566a;
  font-size: 12px;
  line-height: 1.6;
}

.config-ai-manual-guidance {
  margin-top: 10px;
  border-left: 3px solid #6f54a8;
  padding: 8px 10px;
  background: #f7f4fb;
}

.config-ai-manual-guidance strong {
  color: #5b428c;
  font-size: 11px;
}

.config-ai-manual-guidance p {
  margin: 3px 0 0;
  color: #4f4563;
  font-size: 12px;
  line-height: 1.55;
}

.config-ai-parameter-empty {
  margin-top: 10px;
  border: 1px dashed #c4cfdd;
  padding: 10px;
  background: #fff;
  color: #687589;
  font-size: 12px;
  line-height: 1.6;
}

.config-ai-parameter-review {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #d8e4f1;
}

.config-ai-parameter-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.config-ai-parameter-title strong {
  font-size: 13px;
}

.config-ai-parameter-title small {
  color: #6d7b8e;
  font-size: 11px;
}

.config-ai-parameter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 9px;
  margin-top: 9px;
}

.config-ai-parameter-item {
  min-width: 0;
  border: 1px solid #d7e1ed;
  border-top: 3px solid #5b9b7d;
  border-radius: 5px;
  padding: 10px;
  background: #fff;
}

.config-ai-parameter-item.adjust {
  border-top-color: #d89a16;
  background: #fffdf7;
}

.config-ai-parameter-item.insufficient {
  border-top-color: #8794a5;
  background: #fafbfc;
}

.config-ai-parameter-item header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.config-ai-parameter-item header > div {
  display: grid;
  gap: 1px;
}

.config-ai-parameter-item header strong {
  font-size: 13px;
}

.config-ai-parameter-item header small {
  color: #7b8797;
  font-size: 10px;
}

.config-ai-parameter-item header > span {
  flex: 0 0 auto;
  border-radius: 10px;
  padding: 2px 7px;
  background: #e5f3ec;
  color: #236c4e;
  font-size: 10px;
  font-weight: 700;
}

.config-ai-parameter-item.adjust header > span {
  background: #fff0ca;
  color: #8b5b00;
}

.config-ai-parameter-item.insufficient header > span {
  background: #e9edf2;
  color: #596678;
}

.config-ai-parameter-values {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
  border-block: 1px solid #e6ecf3;
  padding: 7px 0;
}

.config-ai-parameter-values span {
  display: grid;
  gap: 1px;
}

.config-ai-parameter-values small {
  color: #7a8797;
  font-size: 10px;
}

.config-ai-parameter-values b {
  color: #213047;
  font-size: 13px;
}

.config-ai-parameter-values span:last-child b {
  color: #126b4a;
}

.config-ai-parameter-values i {
  color: #8a96a5;
  font-style: normal;
}

.config-ai-detection-impact {
  margin-top: 7px;
  border-radius: 3px;
  padding: 4px 6px;
  background: #edf1f5;
  color: #5b687a;
  font-size: 10px;
  font-weight: 700;
}

.config-ai-detection-impact.enhanced {
  background: #e7f5ed;
  color: #176b49;
}

.config-ai-detection-impact.reduced {
  background: #fff0e4;
  color: #a04a0a;
}

.config-ai-parameter-item > p {
  margin: 8px 0 0;
  color: #3f4d61;
  font-size: 11px;
  line-height: 1.55;
}

.config-ai-parameter-item dl {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 5px;
  margin: 7px 0 0;
  font-size: 10px;
  line-height: 1.5;
}

.config-ai-parameter-item dt {
  color: #758296;
  font-weight: 700;
}

.config-ai-parameter-item dd {
  min-width: 0;
  margin: 0;
  color: #47566a;
}

.config-ai-parameter-evidence {
  margin-top: 7px;
  border-top: 1px dashed #d9e1eb;
  padding-top: 7px;
}

.config-ai-parameter-evidence > strong {
  color: #667489;
  font-size: 10px;
}

.config-ai-parameter-evidence ul {
  margin: 4px 0 0;
  padding-left: 16px;
  color: #536176;
  font-size: 10px;
  line-height: 1.5;
}

.config-ai-safety-note {
  margin: 9px 0 0;
  border-left: 3px solid #d89a16;
  padding: 7px 9px;
  background: #fff9e9;
  color: #73551b;
  font-size: 11px;
}

.config-ai-diff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.config-ai-diff-item {
  border: 1px solid #d8e4f2;
  border-radius: 5px;
  padding: 8px 10px;
  background: #fff;
}

.config-ai-diff-item > span {
  display: block;
  color: #5e6d81;
  font-size: 11px;
}

.config-ai-diff-item > span small {
  margin-left: 3px;
  color: #8a96a5;
}

.config-ai-diff-item > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 4px;
}

.config-ai-diff-item del {
  color: #7e8998;
  font-size: 13px;
}

.config-ai-diff-item b {
  color: #8b98a9;
  font-weight: 400;
}

.config-ai-diff-item strong {
  color: #0f6d4b;
  font-size: 15px;
}

.config-ai-recommendation .config-ai-step {
  padding-top: 8px;
  border-top: 1px solid #dce6f1;
  color: #315c8d;
  font-weight: 600;
}

.form-grid label.ai-suggested-field {
  color: #126b4a;
  font-weight: 700;
}

.form-grid label.ai-suggested-field input {
  border-color: #1a9368;
  background: #effaf5;
  color: #124e3b;
  box-shadow: 0 0 0 2px rgba(26, 147, 104, 0.12);
}

@media (max-width: 720px) {
  .record-order-link-targets {
    grid-template-columns: 1fr;
  }

  .curve-order-context {
    align-items: flex-start;
    flex-direction: column;
  }

  .config-ai-parameter-title {
    display: grid;
  }

  .config-ai-parameter-grid {
    grid-template-columns: 1fr;
  }
}

.config-default-note {
  margin: -2px 0 14px;
  padding: 9px 11px;
  border-left: 3px solid #2f77d0;
  background: #f3f8ff;
  color: #45617f;
  font-size: 12px;
}

.raw-query {
  margin-top: 0;
}

.raw-list {
  display: grid;
  gap: 6px;
}

.raw-error {
  border-color: #efb2b2;
  color: var(--bad);
}

.raw-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.raw-row {
  display: grid;
  grid-template-columns: 16px 92px 120px 120px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  cursor: pointer;
  list-style: none;
}

.raw-row::-webkit-details-marker {
  display: none;
}

.raw-row::before {
  content: "›";
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}

.raw-item[open] .raw-row::before {
  transform: rotate(90deg);
}

.raw-time,
.raw-device,
.raw-brief {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.raw-time {
  color: var(--muted);
}

.raw-device {
  color: var(--ink);
}

.raw-brief {
  color: var(--muted);
}

.raw-brief.alarm {
  color: var(--bad);
  font-weight: 700;
}

.raw-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.raw-head strong {
  display: block;
  margin-bottom: 4px;
}

.raw-head small,
.raw-summary {
  color: var(--muted);
}

.raw-interpretation {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  background: #fbfdff;
  border-bottom: 1px solid var(--line);
}

.raw-interpretation-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.raw-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.raw-field {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #ffffff;
}

.raw-field small {
  color: var(--muted);
}

.raw-field strong {
  color: var(--ink);
  font-size: 14px;
  word-break: break-word;
}

.raw-status-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.raw-type {
  border-radius: 999px;
  padding: 4px 8px;
  background: #eef5ff;
  color: var(--brand-dark);
  font-size: 12px;
  white-space: nowrap;
  text-align: center;
}

.raw-details {
  background: #ffffff;
}

.raw-details summary {
  padding: 11px 14px;
  color: var(--brand);
  cursor: pointer;
  font-weight: 700;
}

.raw-json {
  margin: 0;
  max-height: 360px;
  overflow: auto;
  padding: 12px 14px;
  background: #0f172a;
  color: #dbeafe;
  font-size: 12px;
  line-height: 1.55;
}

.curve-chart-wrap {
  position: relative;
}

.curve-chart {
  display: block;
  width: 100%;
  height: auto;
  min-height: 300px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.curve-legend {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  margin: 8px 0 10px;
}

.legend-item {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--curve-temperature);
}

.legend-dot.power {
  background: var(--curve-power);
}

.legend-dot.anomaly {
  background: var(--curve-anomaly);
}

.curve-line {
  fill: none;
  stroke: var(--curve-temperature);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.curve-line.power {
  stroke: var(--curve-power);
}

.curve-axis,
.curve-grid {
  stroke: #d7dfeb;
  stroke-width: 1;
}

.curve-grid {
  stroke-dasharray: 3 4;
}

.curve-grid-vertical {
  stroke: #e6ebf2;
}

.curve-tick {
  stroke: #9aa7b8;
  stroke-width: 1;
}

.curve-label {
  fill: var(--muted);
  font-size: 11px;
}

.curve-label-left {
  text-anchor: end;
}

.curve-time-label {
  font-size: 10px;
}

.curve-label.power {
  fill: var(--curve-power);
}

.curve-axis-title {
  fill: var(--curve-temperature);
  font-size: 12px;
  font-weight: 700;
}

.curve-axis-title.power {
  fill: var(--curve-power);
}

.curve-point {
  fill: #ffffff;
  stroke: var(--curve-temperature);
  stroke-width: 1.4;
}

.curve-point.power {
  stroke: var(--curve-power);
}

.curve-anomalies {
  pointer-events: none;
}

.curve-anomaly-line {
  stroke: rgba(124, 58, 237, 0.55);
  stroke-width: 1.2;
  stroke-dasharray: 4 4;
}

.curve-anomaly-point {
  fill: #ffffff;
  stroke: var(--curve-anomaly);
  stroke-width: 3;
}

.curve-hover {
  pointer-events: none;
  opacity: 0;
  transition: opacity 80ms ease;
}

.curve-hover.visible {
  opacity: 1;
}

.curve-crosshair {
  stroke: #64748b;
  stroke-width: 1;
  stroke-dasharray: 4 3;
}

.curve-hover-point {
  fill: #ffffff;
  stroke: var(--curve-temperature);
  stroke-width: 3;
}

.curve-hover-point.power {
  stroke: var(--curve-power);
}

.curve-hit-area {
  fill: transparent;
  cursor: crosshair;
  pointer-events: all;
}

.curve-tooltip {
  position: absolute;
  z-index: 2;
  display: grid;
  gap: 5px;
  min-width: 190px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 9px 11px;
  transform: translate(-50%, -100%);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.16);
  color: var(--muted);
  font-size: 12px;
  pointer-events: none;
}

.curve-tooltip strong {
  color: var(--ink);
}

.curve-tooltip span {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 6px;
  align-items: center;
}

.curve-tooltip .tooltip-secondary {
  grid-template-columns: 1fr auto;
  padding-left: 16px;
}

.curve-tooltip .tooltip-anomaly {
  grid-template-columns: 42px minmax(0, 1fr);
  border-top: 1px solid #f2c7c7;
  padding-top: 5px;
  color: var(--bad);
}

.curve-tooltip .tooltip-anomaly b {
  color: var(--bad);
}

.curve-tooltip b {
  color: var(--ink);
}

.tooltip-dot {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--curve-temperature);
}

.tooltip-dot.power {
  background: var(--curve-power);
}

.link-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  background: #ffffff;
  color: var(--brand);
  cursor: pointer;
}

.link-button:disabled {
  cursor: not-allowed;
  color: var(--muted);
  background: #f7f9fc;
}

.config-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 16px;
}

.user-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.45fr) minmax(0, 1fr);
  gap: 16px;
}

.user-stack {
  display: grid;
  gap: 16px;
  align-content: start;
}

.panel {
  padding: 18px;
}

.form-row,
.form-grid {
  display: grid;
  gap: 12px;
}

.form-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 12px;
}

#groupReadDeviceField {
  grid-column: 1 / -1;
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid input,
.form-row select {
  min-width: 0;
  width: 100%;
}

.fixed-config-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 12px;
  min-height: 62px;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f1f5f9;
  color: #475569;
}

.fixed-config-field strong {
  color: #0f766e;
  font-size: 14px;
}

.fixed-config-field small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
}

.primary {
  margin-top: 16px;
  border: 0;
  border-radius: 8px;
  padding: 11px 16px;
  background: var(--brand);
  color: white;
  cursor: pointer;
  font-weight: 700;
}

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

.primary:disabled {
  cursor: not-allowed;
  background: #a9b4c4;
}

.message {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--muted);
}

.message.error {
  color: var(--bad);
}

.command-confirmed {
  color: var(--ok);
  font-weight: 700;
}

.form-title {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 14px;
}

.device-checkboxes {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
}

.check-row {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
}

.check-row input {
  min-width: 0;
  width: auto;
}

.user-list {
  display: grid;
  gap: 12px;
}

.user-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.user-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.user-head strong {
  display: block;
  margin-bottom: 4px;
}

.user-head small {
  color: var(--muted);
}

.user-edit {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.compact-primary {
  margin-top: 0;
  padding-inline: 18px;
}

.user-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.user-summary > div {
  padding: 14px 16px;
  border-right: 1px solid var(--line);
}

.user-summary > div:last-child {
  border-right: 0;
}

.user-summary span,
.user-summary strong {
  display: block;
}

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

.user-summary strong {
  margin-top: 4px;
  font-size: 22px;
}

.user-management-grid {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.user-directory {
  padding: 0;
  overflow: hidden;
}

.user-directory-head,
.user-panel-head,
.permission-title,
.permission-group-head,
.user-editor-actions,
.user-form-actions,
.admin-security summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.user-directory-head {
  padding: 16px 16px 10px;
}

.user-directory-head h2,
.user-panel-head h2 {
  margin: 0;
}

.user-directory-head p,
.user-panel-head p,
.user-editor-empty p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

#userDirectoryCount {
  border-radius: 999px;
  padding: 4px 8px;
  background: #eef4fd;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.user-search {
  display: block;
  padding: 0 14px 12px;
}

.user-search span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.user-search input {
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  background: #f8fafc;
}

.user-list {
  border-top: 1px solid var(--line);
}

.user-list-row {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

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

.user-list-row:hover {
  background: #f7faff;
}

.user-list-row.selected {
  background: #edf4ff;
}

.user-list-row.selected::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--brand);
  content: "";
}

.user-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #dceaff;
  color: #0f4ea8;
  font-size: 15px;
  font-weight: 800;
}

.user-avatar.large {
  width: 48px;
  height: 48px;
  font-size: 19px;
}

.user-list-copy,
.user-list-copy strong,
.user-list-copy small {
  display: block;
  min-width: 0;
}

.user-list-copy strong,
.user-list-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-list-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.account-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--idle);
}

.account-dot.active {
  background: var(--ok);
}

.user-list-empty,
.user-editor-empty {
  padding: 32px 18px;
  color: var(--muted);
  text-align: center;
}

.user-list-empty p {
  margin: 5px 0 0;
  font-size: 12px;
}

.user-detail-column {
  min-width: 0;
}

.user-editor,
.user-create-panel {
  min-height: 420px;
}

.user-panel-head {
  align-items: flex-start;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
}

.panel-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
}

.user-identity-large {
  display: flex;
  align-items: center;
  gap: 12px;
}

.account-state {
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 700;
}

.account-state.active {
  background: #e7f7ef;
  color: #117a43;
}

.account-state.disabled {
  background: #eef1f5;
  color: var(--muted);
}

.user-access-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.user-access-overview span {
  padding: 11px 12px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.user-access-overview span:last-child {
  border-right: 0;
}

.user-access-overview strong {
  color: var(--ink);
  font-size: 17px;
}

.user-account-fields {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(280px, 1.3fr);
  align-items: end;
  gap: 12px;
  margin-bottom: 16px;
}

.user-account-fields input,
.user-account-fields select,
.user-credentials input,
.user-credentials select,
.admin-password-form input {
  width: 100%;
}

.role-access-note {
  padding: 11px 13px;
  border: 1px solid #bfd5f4;
  border-radius: 6px;
  background: #f2f7ff;
  color: #365b8d;
  font-size: 12px;
  line-height: 1.5;
}

.role-access-note[hidden] {
  display: none;
}

.permission-section {
  margin-top: 14px;
}

.permission-title {
  align-items: flex-end;
  margin-bottom: 10px;
}

.permission-title strong,
.permission-title small {
  display: block;
}

.permission-title small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.permission-title > span {
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.permission-groups {
  display: block;
  max-height: 430px;
  overflow: auto;
  padding-right: 2px;
}

.permission-all-groups,
.permission-group-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
}

.permission-all-groups {
  margin-bottom: 10px;
  padding: 11px 12px;
  background: #f8fafc;
}

.permission-group-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.permission-group-row {
  padding: 10px 11px;
}

.permission-all-groups.selected,
.permission-group-row.selected {
  border-color: #9bbcf0;
  background: #eef5ff;
}

.permission-all-groups input,
.permission-group-row input {
  width: auto;
  min-width: 0;
}

.permission-all-groups span,
.permission-all-groups strong,
.permission-all-groups small,
.permission-group-row span,
.permission-group-row strong,
.permission-group-row small {
  display: block;
  min-width: 0;
}

.permission-all-groups small,
.permission-group-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.permission-group {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.permission-group.full-access {
  border-color: #9bbcf0;
  background: #f4f8ff;
}

.permission-group-head {
  padding: 10px 11px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.permission-group.full-access .permission-group-head {
  background: #e7f0ff;
}

.permission-group-head strong,
.permission-group-head small {
  display: block;
}

.permission-group-head small,
.ungrouped-label {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.group-access-toggle {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 6px;
  color: var(--brand);
  font-weight: 700;
  cursor: pointer;
}

.permission-group-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.permission-group-actions > button {
  border: 0;
  padding: 3px 5px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}

.permission-group-actions > button:hover {
  color: var(--brand);
  text-decoration: underline;
}

.group-access-toggle input,
.permission-device input {
  width: auto;
  min-width: 0;
}

.permission-device-list {
  display: grid;
}

.permission-device {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border-bottom: 1px solid #edf0f5;
  color: var(--ink);
  cursor: pointer;
}

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

.permission-device:hover {
  background: #f8fafc;
}

.permission-device span,
.permission-device strong,
.permission-device small {
  display: block;
  min-width: 0;
}

.permission-device strong,
.permission-device small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.permission-device small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.permission-device em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.permission-group.full-access .permission-device {
  background: #f8fbff;
}

.user-editor-actions,
.user-form-actions {
  justify-content: flex-start;
  margin-top: 16px;
}

.user-editor-actions .primary,
.user-form-actions .primary {
  margin-top: 0;
}

.user-form-actions .message {
  margin: 0;
}

.admin-security {
  margin-top: 16px;
  padding: 0;
}

.admin-security summary {
  padding: 15px 18px;
  cursor: pointer;
  list-style: none;
}

.admin-security summary::-webkit-details-marker {
  display: none;
}

.admin-security summary span,
.admin-security summary strong,
.admin-security summary small {
  display: block;
}

.admin-security summary small,
.admin-security summary > span:last-child {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.admin-password-form {
  max-width: 760px;
  padding: 0 18px 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.command-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.command {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.command.failed {
  border-left: 3px solid var(--bad);
}

.command.confirmed {
  border-left: 3px solid var(--good);
}

.command > summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 11px;
  cursor: pointer;
  list-style-position: inside;
}

.command > summary span:first-child {
  display: grid;
  gap: 3px;
}

.command > summary small,
.config-history-head small {
  color: var(--muted);
  font-size: 12px;
}

.command-result {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
}

.command-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 0 11px 9px;
  color: var(--muted);
  font-size: 12px;
}

.command > .raw-summary,
.command > .raw-details,
.command > .message {
  margin-right: 11px;
  margin-left: 11px;
}

.command > .raw-details:last-child {
  margin-bottom: 11px;
}

.config-history-head,
.config-history-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.config-history-head h2 {
  margin-bottom: 3px;
}

.config-history-head > span,
.config-history-pager {
  color: var(--muted);
  font-size: 12px;
}

.config-history-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 0.55fr);
  gap: 10px;
  margin-top: 14px;
}

.config-history-filters label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.config-history-filters select {
  width: 100%;
}

.config-history-pager {
  justify-content: center;
  margin-top: 14px;
}

.auto-config-panel {
  margin-top: 16px;
}

.auto-config-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.7fr) minmax(0, 1.3fr);
  gap: 20px;
}

.auto-config-form {
  display: grid;
  gap: 12px;
  align-content: start;
}

.auto-config-form > label:not(.check-row) {
  display: grid;
  gap: 6px;
}

.auto-config-list-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 10px;
}

.auto-config-list-head small {
  color: var(--muted);
  font-size: 12px;
}

.auto-config-plan-list {
  display: grid;
  gap: 7px;
  max-height: 500px;
  overflow-y: auto;
  padding-right: 3px;
}

.auto-config-plan {
  display: grid;
  grid-template-columns: minmax(140px, 0.9fr) minmax(180px, 1.4fr) auto auto;
  align-items: center;
  gap: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
}

.auto-config-plan.disabled {
  background: #f7f8fa;
}

.auto-config-plan-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.auto-config-plan-title strong,
.auto-config-plan-title small,
.auto-config-plan-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auto-config-plan-title small,
.auto-config-plan-meta {
  color: var(--muted);
  font-size: 12px;
}

.auto-config-plan-meta {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 3px 12px;
  margin: 0;
}

.auto-config-last-run {
  grid-column: 1 / -1;
  margin: 0;
  border-left: 3px solid var(--line);
  padding: 4px 7px;
  overflow: hidden;
  background: #f8fafc;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auto-config-last-run.confirmed,
.auto-config-last-run.simulated-sent {
  border-left-color: var(--good);
}

.auto-config-last-run.failed {
  border-left-color: var(--bad);
}

.auto-config-last-run.skipped {
  border-left-color: var(--warn);
}

.auto-config-plan-actions {
  display: flex;
  gap: 5px;
  justify-content: flex-end;
}

.auto-config-plan-actions .secondary-button {
  min-height: 32px;
  padding: 5px 9px;
  white-space: nowrap;
}

.help-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(140px, 1fr) auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 18px;
}

.help-search input {
  width: 100%;
}

.help-search-result {
  align-self: center;
  color: var(--muted);
  font-size: 13px;
}

.help-actions {
  display: flex;
  gap: 8px;
}

.help-layout {
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.help-toc {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 3px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 14px;
}

.help-toc > strong {
  padding: 5px 8px 10px;
  color: var(--ink);
  font-size: 14px;
}

.help-toc button {
  border: 0;
  border-radius: 6px;
  padding: 8px;
  background: transparent;
  color: #445066;
  text-align: left;
  cursor: pointer;
}

.help-toc button:hover,
.help-toc button:focus-visible {
  background: #eaf2ff;
  color: var(--brand-dark);
}

.help-document {
  min-width: 0;
  max-width: 1040px;
  margin: 0 auto;
  color: #263248;
  line-height: 1.72;
}

.help-document code {
  border-radius: 4px;
  padding: 1px 5px;
  background: #edf2f8;
  color: #193b69;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92em;
}

.help-cover {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 30px;
  background: var(--panel);
}

.help-cover h2 {
  margin: 7px 0 10px;
  color: #173a68;
  font-size: 30px;
}

.help-cover > p {
  max-width: 760px;
  color: var(--muted);
  font-size: 15px;
}

.help-kicker {
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}

.help-role-grid,
.help-status-grid,
.help-checklist-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.help-role-grid {
  margin: 22px 0 16px;
}

.help-role-grid > div {
  border-left: 3px solid var(--brand);
  padding: 8px 12px;
  background: #f4f7fb;
}

.help-role-grid strong,
.help-role-grid span {
  display: block;
}

.help-role-grid span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.help-section {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 18px;
  scroll-margin-top: 20px;
  padding: 34px 4px;
  border-bottom: 1px solid var(--line);
}

.help-section-number {
  color: #9aa7ba;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.help-section h2 {
  margin-bottom: 8px;
  color: #173a68;
  font-size: 23px;
}

.help-section h3 {
  margin: 22px 0 8px;
  color: #254d80;
  font-size: 16px;
}

.help-section p,
.help-section li {
  font-size: 14px;
}

.help-section ul,
.help-steps {
  margin: 12px 0 18px;
  padding-left: 22px;
}

.help-section li + li {
  margin-top: 7px;
}

.help-admin-badge {
  display: inline-block;
  margin-left: 7px;
  border-radius: 999px;
  padding: 2px 8px;
  background: #e7effb;
  color: #225eaa;
  font-size: 11px;
  vertical-align: middle;
}

.help-note {
  margin: 16px 0;
  border-left: 3px solid var(--brand);
  padding: 11px 14px;
  background: #eef4fc;
  font-size: 13px;
}

.help-note-warning {
  border-left-color: #c49100;
  background: #fff7dc;
}

.help-note-danger {
  border-left-color: var(--bad);
  background: #fff0f0;
  color: #8d2424;
}

.help-figure {
  margin: 20px 0;
}

.help-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f9fc;
}

.help-figure figcaption {
  margin-top: 7px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.help-status-grid {
  margin: 16px 0;
}

.help-state {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 11px 13px;
}

.help-state strong,
.help-state span {
  display: block;
}

.help-state span {
  margin-top: 3px;
  font-size: 12px;
}

.help-state-aging {
  border-color: #9bd4b0;
  background: #eaf8ef;
  color: #126c3d;
}

.help-state-idle {
  border-color: #a9c8ef;
  background: #edf4fd;
  color: #225d9f;
}

.help-state-paused {
  border-color: #e7c277;
  background: #fff6dd;
  color: #845000;
}

.help-state-failed {
  border-color: #efa2a2;
  background: #fff0f0;
  color: #a52727;
}

.help-state-offline {
  border-color: #c2c8d1;
  background: #eef0f3;
  color: #5d6673;
}

.help-table-wrap {
  overflow-x: auto;
}

.help-table {
  width: 100%;
  margin: 16px 0;
  border-collapse: collapse;
  background: #ffffff;
  font-size: 13px;
}

.help-table th,
.help-table td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.help-table th {
  background: #eaf0f8;
  color: #27486f;
}

.help-status-table td:first-child,
.help-status-table td:nth-child(2) {
  white-space: nowrap;
}

.help-faq-list {
  border-top: 1px solid var(--line);
}

.help-faq-list details {
  border-bottom: 1px solid var(--line);
}

.help-faq-list summary {
  padding: 13px 4px;
  color: #264c7b;
  font-weight: 700;
  cursor: pointer;
}

.help-faq-list details p {
  margin: 0;
  padding: 0 4px 14px;
  color: var(--muted);
}

.help-checklist-grid > section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #ffffff;
}

.help-checklist-grid h3 {
  margin-top: 0;
}

.help-checklist-grid label {
  display: flex;
  grid-template-columns: none;
  gap: 9px;
  align-items: flex-start;
  padding: 6px 0;
  color: #35425a;
}

.help-checklist-grid input {
  min-width: 0;
  margin-top: 3px;
}

.help-updated {
  margin-top: 20px;
  color: var(--muted);
  text-align: right;
}

.help-no-results::after {
  display: block;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 42px 20px;
  background: #ffffff;
  color: var(--muted);
  text-align: center;
  content: "没有找到相关说明，请尝试更短的关键词";
}

@keyframes pulse {
  50% {
    box-shadow: 0 0 0 3px rgba(216, 52, 52, 0.16);
  }
}

@media (max-width: 900px) {
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .topbar > :first-child {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .topbar .connection {
    justify-self: start;
  }

  .topbar .userbar {
    justify-self: end;
  }

  .record-history-actions {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
  }

  .table-column-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(120px, 1fr) auto 48px;
    justify-content: stretch;
  }

  .table-column-panel label,
  .table-column-panel select,
  .table-column-panel input[type="range"] {
    width: 100%;
    min-width: 0;
  }

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

  .devices-head-actions {
    justify-content: flex-start;
  }

  .device-search-field,
  .device-search-field input {
    width: 100%;
  }

  .device-pager,
  .record-pager,
  .raw-pager {
    align-items: flex-start;
    flex-direction: column;
  }

  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    padding: 14px;
  }

  .nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .brand {
    margin-bottom: 12px;
  }

  .sidebar-icp {
    margin-top: 12px;
    padding-top: 8px;
  }

  .summary-grid,
  .config-layout,
  .auto-config-layout,
  .user-layout,
  .user-management-grid,
  .settings-layout,
  .dingtalk-layout,
  .analysis-admin,
  .analysis-detail-grid,
  .ai-report-grid,
  .form-row,
  .form-grid,
  .config-template-fields,
  .user-account-fields {
    grid-template-columns: 1fr;
  }

  .dingtalk-targets {
    grid-template-columns: 1fr;
  }

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

  .auto-config-plan-title {
    grid-column: 1;
    grid-row: 1;
  }

  .auto-config-plan > .status {
    grid-column: 2;
    grid-row: 1;
  }

  .auto-config-plan-actions {
    grid-column: 3;
    grid-row: 1;
  }

  .auto-config-plan-meta,
  .auto-config-last-run {
    grid-column: 1 / -1;
  }

  .user-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .user-summary > div:nth-child(2) {
    border-right: 0;
  }

  .user-summary > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .permission-group-list {
    grid-template-columns: 1fr;
  }

  .analysis-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .latent-comparison,
  .latent-product-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .latent-signals {
    grid-template-columns: 1fr;
  }

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

  .analysis-plan-copy,
  .analysis-plan .analysis-plan-actions {
    grid-column: 1 / -1;
  }

  .analysis-plan .analysis-plan-actions {
    justify-content: flex-start;
  }

  .analysis-metric:nth-child(2) {
    border-right: 0;
  }

  .analysis-metric:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .analysis-scope-options {
    grid-template-columns: 1fr;
  }

  .ai-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-phase-list {
    grid-template-columns: 1fr;
  }

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

  .group-item > span {
    grid-column: 1 / -1;
    text-align: left;
  }

  .group-item > select {
    grid-column: 1 / -1;
  }

  .device-grid {
    grid-template-columns: 1fr;
  }

  .modal-dialog {
    width: calc(100vw - 20px);
    margin: 10px auto;
    max-height: calc(100vh - 20px);
    padding: 14px;
  }

  .device-claim-fields,
  .device-claim-summary {
    grid-template-columns: 1fr;
  }

  .device-claim-summary span {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .device-claim-summary span:last-child {
    border-bottom: 0;
  }

  .help-toolbar,
  .help-layout {
    grid-template-columns: 1fr;
  }

  .help-actions {
    flex-wrap: wrap;
  }

  .help-toc {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
    overflow: visible;
  }

  .help-toc > strong {
    grid-column: 1 / -1;
  }

  .help-cover {
    padding: 22px;
  }

  .help-cover h2 {
    font-size: 25px;
  }

  .help-role-grid,
  .help-status-grid,
  .help-checklist-grid {
    grid-template-columns: 1fr;
  }

  .help-section {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 28px 0;
  }
}

@media (max-width: 560px) {
  .main {
    padding: 16px;
  }

  .topbar {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .topbar .connection,
  .topbar .userbar {
    grid-column: 1;
  }

  .topbar .userbar {
    justify-self: stretch;
    flex-wrap: wrap;
  }
}

@media (max-width: 520px) {
  .record-history-actions,
  .table-column-tools {
    flex-wrap: wrap;
  }

  .record-history-actions > button,
  .table-column-tools,
  .table-column-tools button {
    flex: 1 1 auto;
  }

  .table-column-panel {
    grid-template-columns: auto minmax(100px, 1fr) auto 48px;
  }

  .table-column-panel label {
    grid-column: 1 / -1;
  }
}

.feedback-launcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 60px;
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid #1459c7;
  border-radius: 8px;
  background: #1769df;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.feedback-launcher:hover {
  background: #1459c7;
}

.feedback-launcher strong {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 23px;
  height: 23px;
  padding: 0 5px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #d92d20;
  color: #ffffff;
  font-size: 11px;
  line-height: 19px;
  text-align: center;
}

.nav-item .nav-feedback-badge {
  min-width: 20px;
  margin-left: auto;
  padding: 1px 6px;
  border-radius: 999px;
  background: #d92d20;
  color: #ffffff;
  font-size: 10px;
  line-height: 18px;
  text-align: center;
}

.feedback-management-head {
  align-items: center;
}

.feedback-management-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.feedback-summary-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid #94a3b8;
  border-radius: 8px;
  background: #ffffff;
}

.feedback-summary-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.feedback-summary-card strong {
  font-size: 22px;
}

.feedback-summary-card.pending { border-left-color: #d97706; }
.feedback-summary-card.processing { border-left-color: #1769df; }
.feedback-summary-card.confirmation { border-left-color: #7c3aed; }
.feedback-summary-card.completed { border-left-color: #168a50; }

#feedbackAdminDirectory .feedback-directory {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

#feedbackAdminDirectory .feedback-list {
  max-height: calc(100vh - 330px);
}

.feedback-layout.feedback-submit-only {
  grid-template-columns: minmax(0, 520px);
  justify-content: center;
}

.feedback-layout.feedback-submit-only .feedback-form {
  padding-right: 0;
  border-right: 0;
}

.feedback-dialog {
  width: min(1120px, calc(100vw - 32px));
}

.feedback-head {
  padding-right: 48px;
  border-bottom: 1px solid var(--line);
}

.feedback-head h2 {
  margin: 4px 0 5px;
  font-size: 22px;
}

.feedback-head p {
  margin-bottom: 16px;
  color: var(--muted);
}

.feedback-layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 20px;
  padding-top: 18px;
}

.feedback-form {
  display: grid;
  align-content: start;
  gap: 12px;
  padding-right: 20px;
  border-right: 1px solid var(--line);
}

.feedback-form h3,
.feedback-directory h3,
.feedback-card h4 {
  margin: 0;
}

.feedback-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.feedback-form input,
.feedback-form select,
.feedback-form textarea,
.feedback-filters input,
.feedback-filters select,
.feedback-admin-actions textarea,
.feedback-confirm-actions textarea {
  width: 100%;
}

.feedback-page-context {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.feedback-directory {
  min-width: 0;
}

.feedback-directory-head,
.feedback-card header,
.feedback-meta,
.feedback-pager,
.feedback-pager > div,
.feedback-confirm-actions > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.feedback-directory-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.feedback-filters {
  display: grid;
  grid-template-columns: 140px 140px minmax(150px, 1fr);
  gap: 8px;
  margin: 14px 0 10px;
}

.feedback-list {
  display: grid;
  gap: 9px;
  max-height: calc(100vh - 270px);
  padding-right: 4px;
  overflow: auto;
}

.feedback-card {
  border: 1px solid var(--line);
  border-left: 4px solid #94a3b8;
  border-radius: 8px;
  padding: 13px 14px;
  background: #ffffff;
}

.feedback-card.feedback-status-pending,
.feedback-card.feedback-status-reopened {
  border-left-color: #d97706;
}

.feedback-card.feedback-status-processing {
  border-left-color: #1769df;
}

.feedback-card.feedback-status-awaiting_confirmation {
  border-left-color: #7c3aed;
  background: #fbf9ff;
}

.feedback-card.feedback-status-completed {
  border-left-color: #168a50;
  background: #f7fcf9;
}

.feedback-card header > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.feedback-card header time,
.feedback-meta,
.feedback-submitter {
  color: var(--muted);
  font-size: 11px;
}

.feedback-card h4 {
  margin-top: 9px;
  font-size: 15px;
}

.feedback-type,
.feedback-status {
  display: inline-flex;
  padding: 3px 7px;
  border-radius: 4px;
  background: #edf2f8;
  color: #42526a;
  font-size: 11px;
  font-weight: 700;
}

.feedback-type-bug {
  background: #fff0f0;
  color: #b42318;
}

.feedback-type-feature {
  background: #eef4ff;
  color: #175cd3;
}

.feedback-type-optimization {
  background: #ecfdf3;
  color: #067647;
}

.feedback-description,
.feedback-resolution p,
.feedback-history p {
  white-space: pre-wrap;
  word-break: break-word;
}

.feedback-description {
  margin: 8px 0;
  color: var(--ink);
  line-height: 1.55;
}

.feedback-submitter {
  margin: 4px 0 0;
}

.feedback-meta {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 8px;
}

.feedback-resolution,
.feedback-confirm-actions,
.feedback-admin-actions,
.feedback-waiting {
  margin-top: 11px;
  padding: 10px;
  border-radius: 6px;
  background: #f4f7fb;
}

.feedback-resolution strong {
  color: #0c7d43;
  font-size: 12px;
}

.feedback-resolution p,
.feedback-confirm-actions p,
.feedback-waiting {
  margin: 5px 0 0;
}

.feedback-admin-actions,
.feedback-confirm-actions {
  display: grid;
  gap: 8px;
}

.feedback-admin-actions > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feedback-confirm-actions {
  background: #f3efff;
}

.feedback-confirm-actions > div {
  justify-content: flex-start;
}

.feedback-waiting {
  color: #6941c6;
  font-size: 12px;
}

.feedback-history {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.feedback-history summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}

.feedback-history ol {
  display: grid;
  gap: 7px;
  margin: 9px 0 0;
  padding-left: 18px;
}

.feedback-history li {
  padding-left: 3px;
  font-size: 12px;
}

.feedback-history li span {
  margin-left: 8px;
  color: var(--muted);
}

.feedback-history p {
  margin: 3px 0 0;
  color: var(--muted);
}

.feedback-empty {
  padding: 42px 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.feedback-empty.error {
  color: var(--bad);
}

.feedback-pager {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 780px) {
  .feedback-layout {
    grid-template-columns: 1fr;
  }

  .feedback-form {
    padding: 0 0 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .feedback-filters {
    grid-template-columns: 1fr;
  }

  .feedback-list {
    max-height: none;
  }

  .feedback-management-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media print {
  body {
    background: #ffffff;
  }

  .sidebar,
  .topbar,
  .help-toolbar,
  .help-toc {
    display: none !important;
  }

  .feedback-launcher,
  #feedbackModal {
    display: none !important;
  }

  .shell,
  .main,
  .help-layout {
    display: block;
  }

  .main {
    padding: 0;
    overflow: visible;
  }

  .view {
    display: none !important;
  }

  #help.view {
    display: block !important;
  }

  .help-document {
    max-width: none;
    color: #111827;
  }

  .help-cover,
  .help-checklist-grid > section {
    break-inside: avoid;
    box-shadow: none;
  }

  .help-section {
    break-before: auto;
  }

  .help-figure img {
    max-height: 620px;
    object-fit: contain;
  }
}

.ai-settings {
  margin-top: 18px;
}

.ai-settings-form {
  display: grid;
  gap: 14px;
  max-width: 900px;
}

.record-evaluation-panel {
  margin: 14px 0;
  padding: 16px;
  border: 1px solid #cfdced;
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  background: #f8fbff;
}

.record-evaluation-head,
.record-ai-adjustment > div,
.ai-report-insight-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.record-evaluation-head span:first-child,
.ai-report-insight-head span {
  color: var(--muted);
  font-size: 12px;
}

.record-evaluation-head h3,
.ai-report-insight-head h4 {
  margin: 3px 0 0;
}

.record-learning-progress {
  margin: 10px 0 14px;
  color: #31547c;
  font-size: 13px;
}

.record-evaluation-form {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(220px, 0.8fr) minmax(300px, 1.5fr);
  gap: 12px;
  align-items: end;
}

.record-evaluation-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 42px;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.record-evaluation-choice label {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 10px;
  border: 1px solid #d6dfeb;
  border-radius: 6px;
  background: #f8fafc;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}

.record-evaluation-choice input[type="radio"] {
  width: 16px;
  height: 16px;
  min-width: 0;
  margin: 0;
  padding: 0;
}

.record-evaluation-option.normal:has(input:checked) {
  border-color: #57b87b;
  background: #eaf8ef;
  color: #18743b;
}

.record-evaluation-option.problem:has(input:checked) {
  border-color: #df6a6a;
  background: #fff0f0;
  color: #b42323;
}

.record-evaluation-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
}

.record-ai-adjustment {
  margin-top: 14px;
  padding: 13px;
  border: 1px solid #b9dfca;
  border-radius: 6px;
  background: #f0faf4;
}

.record-ai-adjustment p {
  margin: 8px 0;
}

.ai-report-insight {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid #cfdced;
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  background: #f8fbff;
}

.ai-report-insight.high,
.ai-report-insight.failed {
  border-left-color: var(--bad);
  background: #fff7f7;
}

.ai-report-insight.medium {
  border-left-color: var(--warn);
  background: #fffaf0;
}

.ai-report-insight.low {
  border-left-color: var(--ok);
  background: #f2fbf6;
}

.ai-report-insight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.ai-report-insight-grid h5 {
  margin: 0 0 6px;
}

.ai-report-insight-grid ul {
  margin: 0;
  padding-left: 20px;
  color: #43516a;
}

@media (max-width: 960px) {
  .record-evaluation-form,
  .ai-report-insight-grid {
    grid-template-columns: 1fr;
  }
}

.role-management-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.role-directory,
.role-editor {
  padding: 0;
  overflow: hidden;
}

.role-directory-head,
.role-editor-head,
.role-editor-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.audit-retention-note {
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef4fd;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.audit-toolbar input,
.audit-toolbar select {
  min-width: 130px;
}

.audit-toolbar #auditKeyword {
  min-width: 210px;
}

.audit-table {
  min-width: 1120px;
}

.audit-table th,
.audit-table td {
  padding: 10px 12px;
}

.audit-time strong,
.audit-time small,
.audit-actor strong,
.audit-actor small,
.audit-operation {
  display: block;
}

.audit-time,
.audit-ip {
  white-space: nowrap;
}

.audit-time small,
.audit-actor small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.audit-category {
  display: inline-block;
  margin-bottom: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #eef4fd;
  color: var(--brand);
  font-size: 11px;
}

.audit-operation {
  max-width: 190px;
}

.audit-target {
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-details {
  position: relative;
}

.audit-details summary {
  color: var(--brand);
  cursor: pointer;
  font-weight: 700;
}

.audit-details[open] {
  min-width: 320px;
}

.audit-details p {
  margin: 8px 0;
  color: var(--bad);
}

.audit-details pre {
  max-width: 520px;
  max-height: 260px;
  margin: 8px 0 0;
  padding: 10px;
  overflow: auto;
  border-radius: 6px;
  background: #111827;
  color: #e5edf8;
  font-size: 11px;
  white-space: pre-wrap;
  word-break: break-all;
}

.audit-error {
  color: var(--bad);
}

.role-directory-head,
.role-editor-head {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.role-directory-head h2,
.role-editor-head h2 {
  margin: 0;
}

.role-directory-head p,
.role-editor-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.role-directory-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.role-directory-actions .primary {
  padding: 7px 10px;
  white-space: nowrap;
}

#roleDirectoryCount,
.role-permission-count {
  flex: 0 0 auto;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eef4fd;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.role-list-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.role-list-row:hover,
.role-list-row.selected {
  background: #f3f7fd;
}

.role-list-row.selected {
  box-shadow: inset 3px 0 0 var(--brand);
}

.role-list-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: #e8f0fc;
  color: var(--brand);
  font-weight: 800;
}

.role-list-row strong,
.role-list-row small {
  display: block;
}

.role-list-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.role-basic-fields {
  display: grid;
  grid-template-columns: minmax(180px, .7fr) minmax(260px, 1.3fr);
  gap: 12px;
  padding: 16px 16px 0;
}

.role-basic-fields input {
  width: 100%;
}

.role-protected-note {
  display: flex;
  gap: 10px;
  margin: 16px;
  padding: 12px;
  border: 1px solid #b9dfca;
  border-radius: 6px;
  background: #f0faf4;
  color: #18743b;
}

.role-permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 16px;
}

.role-permission-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-height: 70px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.role-permission-option.selected {
  border-color: #8bb4ec;
  background: #f2f7fe;
}

.role-permission-option input {
  margin-top: 3px;
}

.role-permission-option strong,
.role-permission-option small {
  display: block;
}

.role-permission-option small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.4;
}

.role-editor-actions {
  padding: 0 16px 16px;
  justify-content: flex-start;
}

@media (max-width: 900px) {
  .device-reclaim-fields,
  .role-management-layout,
  .role-basic-fields,
  .role-permission-grid {
    grid-template-columns: 1fr;
  }
}
