.mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.85);
  box-shadow: var(--shadow);
  white-space: nowrap;
  flex: 0 0 auto;
  width: 170px;
  justify-content: space-between;
}
.mode-toggle-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
  min-width: 88px;
}
.mode-toggle-copy strong { font-size: 12px; }
.api-menu-wrap {
  position: relative;
  margin-left: auto;
  z-index: 25;
}
.api-btn {
  width: auto;
  min-width: 58px;
  padding: 8px 12px;
  border-radius: 12px;
  background: #111827;
  color: #fff;
  border: 1px solid transparent;
  box-shadow: var(--shadow);
  font-weight: 700;
  letter-spacing: 0.4px;
}
.api-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(340px, 88vw);
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.98);
  box-shadow: var(--shadow);
  z-index: 1100;
}
.api-menu-title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
}
.api-menu .btns {
  margin: 10px 0 0;
}
.api-status {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.switch {
  position: relative;
  width: 48px;
  height: 28px;
  display: inline-block;
  flex: 0 0 auto;
}
.switch input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.switch-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #d8d2c6;
  transition: background .2s ease;
}
.switch-slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 4px;
  top: 4px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.16);
  transition: transform .2s ease;
}
.switch input:checked + .switch-slider { background: var(--accent); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); }
.auto-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255,255,255,0.88);
  box-shadow: var(--shadow);
  margin-top: 8px;
}
.auto-panel.minimized {
  padding-bottom: 10px;
}
.auto-panel.minimized #autoResults {
  display: none;
}
.auto-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.auto-panel-title {
  font-size: 14px;
  font-weight: 700;
  margin: 0;
}
.auto-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.auto-entry {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.auto-entry.clickable { cursor: pointer; }
.auto-entry.clickable:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(23, 23, 23, 0.08);
}
.auto-entry.is-active {
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}
.auto-entry-head {
  display: grid;
  grid-template-columns: minmax(120px, 1.3fr) minmax(100px, 1fr) minmax(130px, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.auto-entry-cell { min-width: 0; }
.auto-entry-label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 4px;
}
.auto-entry-value {
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.auto-entry-meta {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}
.auto-entry-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.auto-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--line);
  background: #f8f6f2;
  color: var(--muted);
}
.auto-status.ok {
  border-color: #b8e3c2;
  background: #f2fff5;
  color: #1b5e20;
}
.auto-status.warn {
  border-color: #f6d58f;
  background: #fff8e8;
  color: #9a6700;
}
.auto-status.bad {
  border-color: #f3c2c2;
  background: #fff3f3;
  color: #7f1d1d;
}
.auto-status.live {
  border-color: rgba(15, 118, 110, 0.22);
  background: rgba(15, 118, 110, 0.08);
  color: var(--accent);
}
.auto-empty {
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 18px 14px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  background: rgba(255,255,255,0.6);
}
.detail-banner {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #f3c2c2;
  background: #fff3f3;
  color: #7f1d1d;
  font-size: 13px;
}
.queue-mini {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 12px;
  color: var(--muted);
}
.validation-panel {
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
  position: relative;
}
.validation-body {
  padding: 10px 12px 26px;
}
.validation-row {
  font-size: 13px;
  line-height: 1.42;
  color: var(--muted);
  margin-bottom: 4px;
}
.validation-brandmark {
  position: absolute;
  right: 12px;
  bottom: 8px;
  font-size: 10px;
  line-height: 1;
  color: rgba(29, 28, 26, 0.34);
  pointer-events: none;
  user-select: none;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.validation-brandmark strong {
  color: rgba(66, 133, 244, 0.52);
  font-weight: 700;
}
