/* Prompt-filter rule cards in the Settings tab. A self-contained rule-editor surface with no other consumer. */

/* Prompt filter rules */
.rule-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 0.625rem;
  background: var(--card);
  overflow: hidden;
  transition: border-color 0.15s ease;
}
.rule-card:hover {
  border-color: var(--border-focus);
}
.rule-card.disabled {
  opacity: 0.6;
}
.rule-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.875rem;
}
.rule-header .switch {
  margin-inline-end: 0;
  flex-shrink: 0;
}
.rule-meta {
  display: flex;
  flex-direction: column;
  gap: 0.0625rem;
  min-width: 0;
  flex: 1;
}
.rule-name-input {
  width: 100%;
  border: none !important;
  border-bottom: 1px dashed var(--border) !important;
  background: transparent !important;
  height: auto;
  padding: 0.125rem 0 !important;
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--foreground);
  border-radius: 0 !important;
  transition: border-color 0.12s ease;
}
.rule-name-input:focus {
  border-bottom-color: var(--border-focus) !important;
}
.rule-type {
  font-size: 0.6875rem;
  font-weight: 500;
  margin-top: 4px;
  color: var(--muted-foreground);
  letter-spacing: 0.01em;
}
.rule-remove {
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  border: 1px solid transparent !important;
  border-radius: var(--radius-sm);
  color: var(--muted-foreground);
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: color 0.12s ease;
}
.rule-remove:hover {
  color: var(--destructive);
}
.rule-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem 1.25rem;
  padding: 0.75rem 0.875rem;
  border-top: 1px solid var(--border);
  background: color-mix(in oklab, var(--muted) 30%, var(--card));
}
@media (min-width: 640px) {
  .rule-body {
    grid-template-columns: 1fr 1fr;
  }
  .rule-body > .rule-field:only-child {
    grid-column: 1 / -1;
  }
}
.rule-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}
.rule-field label {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.rule-field input {
  width: 100%;
  height: 1.75rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  background: transparent !important;
  border: 0 !important;
  border-bottom: 1px solid var(--input) !important;
  padding: 0 0.125rem !important;
  border-radius: 0 !important;
  min-width: 0;
  color: var(--foreground);
  transition: border-bottom-color 0.12s ease;
}
.rule-field input::placeholder {
  color: var(--muted-foreground);
  opacity: 0.55;
}
.rule-field input:focus {
  border-bottom-color: var(--border-focus) !important;
}

