.amr-app {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.amr-settings-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.amr-adv-toggle {
  display: none;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.amr-adv-toggle:focus-visible {
  outline: 3px solid #0f766e;
  outline-offset: 2px;
}

.amr-adv-caret {
  color: #0f766e;
  font-family: 'JetBrains Mono', monospace;
}

.amr-mode-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.amr-mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 2px solid #cbd5e1;
  background: #ffffff;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.amr-mode-card:hover {
  border-color: #0f766e;
}

.amr-mode-card.is-active {
  border-color: #0f766e;
  background: #f0fdfa;
  box-shadow: 0 1px 2px rgba(15, 118, 110, 0.12);
}

.amr-mode-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.amr-mode-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: #0f172a;
}

.amr-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  flex-shrink: 0;
}

.amr-badge-teal {
  background: #ccfbf1;
  color: #115e59;
}

.amr-badge-slate {
  background: #e2e8f0;
  color: #334155;
}

.amr-badge-warn {
  background: #fef3c7;
  color: #92400e;
}

.amr-badge-clean {
  background: #d1fae5;
  color: #065f46;
}

.amr-mode-desc {
  font-size: 13px;
  color: #475569;
  line-height: 1.4;
  margin: 0;
}

.amr-sub-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  padding: 8px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.amr-sub-options[hidden] {
  display: none;
}

.amr-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
}

.amr-toggle-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #0f766e;
  cursor: pointer;
}

.amr-toggle-hint {
  font-size: 12px;
  color: #475569;
  font-weight: 400;
}

.amr-dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 20px;
  border: 2px dashed #94a3b8;
  border-radius: 12px;
  background: #ffffff;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.amr-dropzone:hover,
.amr-dropzone.is-dragover {
  border-color: #0f766e;
  background: #f0fdfa;
}

.amr-drop-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #0c141d;
  color: #2dd4bf;
  display: flex;
  align-items: center;
  justify-content: center;
}

.amr-drop-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.amr-drop-sub {
  font-size: 13px;
  color: #475569;
  margin: 0;
  max-width: 600px;
}

.amr-drop-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}

.amr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.amr-btn:focus-visible {
  outline: 3px solid #0f766e;
  outline-offset: 2px;
}

.amr-btn-primary {
  background: #0f766e;
  color: #ffffff;
}

.amr-btn-primary:hover {
  background: #115e59;
}

.amr-btn-secondary {
  background: #ffffff;
  color: #0f172a;
  border-color: #cbd5e1;
}

.amr-btn-secondary:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.amr-btn-sm {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
}

.amr-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.amr-file-input {
  display: none;
}

.amr-summary-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #0c141d;
  color: #f8fafc;
}

.amr-summary-bar[hidden] {
  display: none;
}

.amr-summary-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}

.amr-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.amr-stat-ok {
  color: #34d399;
}

.amr-stat-warn {
  color: #fbbf24;
}

.amr-summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.amr-queue {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.amr-item {
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.amr-item-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
}

.amr-thumb {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  flex-shrink: 0;
}

.amr-item-meta {
  flex: 1 1 220px;
  min-width: 0;
}

.amr-item-name {
  font-weight: 600;
  font-size: 15px;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.amr-item-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #475569;
  margin-top: 3px;
}

.amr-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

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

.amr-xray {
  border-top: 1px solid #1e293b;
  background: #0c141d;
  color: #e2e8f0;
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.amr-xray[hidden] {
  display: none;
}

.amr-xray-col {
  background: #131f2e;
  border: 1px solid #263548;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.amr-xray-col.is-clean {
  border-color: #065f46;
  background: #0b221c;
}

.amr-xray-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.amr-xray-before-label {
  color: #fbbf24;
}

.amr-xray-after-label {
  color: #34d399;
}

.amr-xray-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
}

.amr-xray-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.amr-xray-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.amr-xray-key {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #94a3b8;
}

.amr-xray-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #f8fafc;
  word-break: break-word;
  white-space: pre-wrap;
}

.amr-xray-val.is-risk {
  color: #fde68a;
}

.amr-clean-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: #a7f3d0;
}

.amr-clean-big {
  font-size: 18px;
  font-weight: 700;
  color: #34d399;
}

.amr-status-msg {
  font-size: 13px;
  color: #475569;
}

.amr-status-msg:empty {
  display: none;
}

@media (max-width: 640px) {
  .amr-dropzone {
    order: -2;
    padding: 16px 14px;
    gap: 6px;
  }
  .amr-adv-toggle {
    display: flex;
    order: -1;
  }
  .amr-settings-panel {
    display: none;
  }
  .amr-settings-panel.is-open {
    display: flex;
  }
  .amr-mode-bar,
  .amr-xray {
    grid-template-columns: 1fr;
  }
  .amr-drop-actions,
  .amr-summary-actions,
  .amr-item-actions {
    width: 100%;
  }
  .amr-drop-actions .amr-btn,
  .amr-summary-actions .amr-btn,
  .amr-item-actions .amr-btn {
    width: 100%;
  }
}
