main.content:has(#rtg-app) {
  min-width: 0;
}

.rtg-container {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  color: #1a1a1a;
}

.rtg-container [hidden] {
  display: none !important;
}

.rtg-card {
  box-sizing: border-box;
  background: #f8f9fa;
  border: 1px solid #e1e4e8;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
}

.rtg-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid #e1e4e8;
}

.rtg-card-header h2 {
  margin: 0;
  font-size: 1.2rem;
  color: #2d3436;
}

.rtg-muted {
  margin: 0;
  font-size: 0.85rem;
  color: #636e72;
}

.rtg-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.rtg-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.rtg-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.rtg-field label {
  font-weight: 600;
  font-size: 0.86rem;
  color: #2d3436;
}

.rtg-input,
.rtg-select {
  box-sizing: border-box;
  padding: 0.5rem 0.65rem;
  border: 1px solid #cfd4da;
  border-radius: 6px;
  background: #fff;
  color: #2d3436;
  font-family: inherit;
  font-size: 0.9rem;
}

.rtg-input:focus,
.rtg-select:focus {
  outline: none;
  border-color: #00cec9;
  box-shadow: 0 0 0 2px rgba(0, 206, 201, 0.2);
}

.rtg-btn {
  appearance: none;
  background: #fff;
  border: 1px solid #cfd4da;
  color: #2d3436;
  border-radius: 6px;
  padding: 0.45rem 0.8rem;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.rtg-btn:hover:not(:disabled) {
  border-color: #00cec9;
  background: #e6fffe;
}

.rtg-btn.is-selected {
  background: #2d3436;
  border-color: #2d3436;
  color: #fff;
}

.rtg-btn.is-allow.is-selected {
  background: #00b894;
  border-color: #00b894;
  color: #fff;
}

.rtg-btn.is-disallow.is-selected {
  background: #d63031;
  border-color: #d63031;
  color: #fff;
}

.rtg-btn.is-custom.is-selected {
  background: #0984e3;
  border-color: #0984e3;
  color: #fff;
}

.rtg-btn-primary {
  background: #2d3436;
  border-color: #2d3436;
  color: #fff;
}

.rtg-btn-primary:hover:not(:disabled) {
  background: #00cec9;
  border-color: #00cec9;
  color: #1a1a1a;
}

.rtg-btn-danger {
  background: #fff;
  border-color: #fab1a0;
  color: #c0392b;
  padding: 0.3rem 0.55rem;
  font-size: 0.8rem;
}

.rtg-btn-danger:hover:not(:disabled) {
  background: #fff0f0;
  border-color: #d63031;
}

.rtg-sub-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed #d5d9df;
}

.rtg-sub-section h3 {
  margin: 0 0 0.6rem 0;
  font-size: 0.95rem;
  color: #2d3436;
}

.rtg-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
}

.rtg-chip {
  appearance: none;
  background: #eef1f4;
  border: 1px solid #d5d9df;
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #2d3436;
  cursor: pointer;
}

.rtg-chip:hover {
  border-color: #00cec9;
  background: #e6fffe;
}

.rtg-rule-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.rtg-rule-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.7rem;
  background: #fff;
  border: 1px solid #e1e4e8;
  border-radius: 6px;
  font-size: 0.88rem;
}

.rtg-rule-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-right: 0.4rem;
}

.rtg-rule-badge.is-allow {
  background: #dff9eb;
  color: #008568;
}

.rtg-rule-badge.is-disallow {
  background: #ffe8e8;
  color: #b71c1c;
}

.rtg-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.rtg-filter-bar .rtg-input {
  flex: 1 1 220px;
}

.rtg-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.rtg-bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.6rem 0.8rem;
  background: #eef1f4;
  border-radius: 6px;
  margin-bottom: 0.9rem;
  font-size: 0.85rem;
}

.rtg-bot-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.rtg-bot-card {
  background: #fff;
  border: 1px solid #e1e4e8;
  border-radius: 8px;
  padding: 0.85rem 1rem;
}

.rtg-bot-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.rtg-bot-info {
  flex: 1 1 240px;
  min-width: 0;
}

.rtg-bot-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  font-size: 0.96rem;
  color: #2d3436;
}

.rtg-bot-tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: #f1f2f6;
  color: #57606f;
  border: 1px solid #dfe4ea;
}

.rtg-bot-desc {
  margin: 0.25rem 0 0 0;
  font-size: 0.82rem;
  color: #636e72;
}

.rtg-bot-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.rtg-bot-controls .rtg-btn {
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
}

.rtg-bot-paths {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed #e1e4e8;
}

.rtg-output-card {
  background: #fff;
}

.rtg-output-code {
  margin: 0;
  background: #2f3542;
  color: #f1f2f6;
  padding: 1.15rem 1.25rem;
  border-radius: 8px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.88rem;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre;
  min-height: 120px;
}

@media (max-width: 640px) {
  .rtg-card {
    padding: 1rem;
  }
}
