.local-mode-card {
  margin-bottom: 14px;
  border: 1px solid #c9d8ea;
  border-radius: 12px;
  background: linear-gradient(120deg, #f8fbff, #eef4fb);
  overflow: hidden;
  box-shadow: 0 3px 12px #172b4608;
}
.local-mode-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid #d9e4f0;
}
.local-mode-head > span:first-child {
  flex: 1;
}
.local-mode-head h3 {
  margin: 0 0 5px;
  font-size: 15px;
}
.local-mode-head p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}
.local-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 999px;
  background: #e7f1fb;
  color: #315d8d;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.local-mode-badge:before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3a79b8;
}
.local-mode-actions {
  display: flex;
  gap: 7px;
}
.local-mode-actions button {
  padding: 7px 10px;
  font-size: 10px;
}
.local-mode-body {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1px;
  background: #dce6f1;
}
.local-boundary,
.local-limits {
  padding: 15px 18px;
  background: #fff;
}
.local-boundary h4,
.local-limits h4 {
  margin: 0 0 9px;
  font-size: 12px;
}
.local-boundary ul {
  margin: 0;
  padding-left: 17px;
  color: #58677a;
  font-size: 10px;
  line-height: 1.75;
}
.local-boundary b {
  color: #293b52;
}
.local-limit-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.local-limit-grid label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: #667488;
  font-size: 9px;
}
.local-limit-grid input {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 0 9px;
  color: var(--text);
}
.local-save-state {
  display: block;
  margin-top: 8px;
  color: #55708f;
  font-size: 9px;
}
.local-risk-note {
  margin: 0;
  padding: 11px 16px;
  border-top: 1px solid #ead39d;
  background: #fff8e8;
  color: #725118;
  font-size: 10px;
  line-height: 1.6;
}
.local-risk-note b {
  color: #9a5b00;
}
.automation-audit {
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.automation-audit > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 17px;
  border-bottom: 1px solid var(--line);
}
.automation-audit h3 {
  margin: 0 0 4px;
  font-size: 14px;
}
.automation-audit header p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
}
.automation-audit-summary {
  display: flex;
  align-items: center;
  gap: 8px;
}
.automation-audit-summary b {
  font-size: 11px;
  color: #687587;
}
.automation-audit-summary b.pass {
  color: #17795b;
}
.automation-audit-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
}
.audit-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  background: #fff;
}
.audit-check > i {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #eaf6f1;
  color: #16805e;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}
.audit-check.fail > i {
  background: #fff0f0;
  color: #d83a3a;
}
.audit-check span {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.audit-check b {
  font-size: 10px;
}
.audit-check small {
  color: var(--muted);
  font-size: 8px;
  line-height: 1.45;
}
.custom-help-editor {
  margin-top: 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  overflow: hidden;
}
.custom-help-editor header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 17px;
  border-bottom: 1px solid var(--line);
}
.custom-help-editor h3 {
  margin: 0 0 4px;
  font-size: 14px;
}
.custom-help-editor header p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
}
.custom-help-content {
  padding: 16px 18px;
}
.custom-help-content h4 {
  margin: 0 0 7px;
  font-size: 13px;
}
.custom-help-content p {
  margin: 0;
  color: #59687b;
  font-size: 10px;
  line-height: 1.75;
  white-space: pre-wrap;
}
.custom-help-content footer {
  margin-top: 10px;
  color: #94a0ae;
  font-size: 8px;
}
.custom-help-empty {
  padding: 17px;
  border: 1px dashed #b8c5d5;
  border-radius: 8px;
  background: #f8fafc;
  color: #728094 !important;
}
body.theme-dark .local-mode-card {
  border-color: #354558;
  background: #121820;
}
body.theme-dark .local-mode-head,
body.theme-dark .local-boundary,
body.theme-dark .local-limits,
body.theme-dark .automation-audit,
body.theme-dark .audit-check,
body.theme-dark .custom-help-editor {
  background: #171c24;
  color: #edf1f7;
}
body.theme-dark .local-mode-body,
body.theme-dark .automation-audit-grid {
  background: #303a47;
}
body.theme-dark .local-limit-grid input {
  background: #1d242e;
  border-color: #35404e;
  color: #edf1f7;
}
body.theme-dark .local-risk-note {
  background: #2a241a;
  border-color: #5c4b2c;
  color: #d7c5a4;
}
body.theme-dark .custom-help-content p {
  color: #aeb8c6;
}
body.theme-dark .custom-help-empty {
  background: #1d242e;
  border-color: #455264;
}
@media (max-width: 980px) {
  .local-mode-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .local-mode-actions {
    width: 100%;
  }
  .local-mode-body {
    grid-template-columns: 1fr;
  }
  .automation-audit-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .local-mode-actions {
    flex-wrap: wrap;
  }
  .local-limit-grid {
    grid-template-columns: 1fr;
  }
  .automation-audit > header {
    align-items: flex-start;
    gap: 10px;
    flex-direction: column;
  }
}
