.ctc-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  color: #1e293b;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.5;
}

.ctc-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Controls Card */
.ctc-controls-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ctc-card-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #f1f5f9;
}

.ctc-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  color: #0f172a;
}

.ctc-threshold-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ctc-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
}

.ctc-select {
  height: 44px;
  padding: 0 0.85rem;
  font-size: 0.88rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: inherit;
  box-sizing: border-box;
}

.ctc-select:focus,
.ctc-textarea:focus {
  outline: 2px solid #ef4444;
  outline-offset: 1px;
  border-color: #ef4444;
}

.ctc-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ctc-textarea {
  width: 100%;
  padding: 0.85rem;
  font-size: 0.95rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: inherit;
  box-sizing: border-box;
  font-family: inherit;
  resize: vertical;
}

/* Presets Row */
.ctc-presets-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.ctc-presets-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748b;
  margin-right: 0.25rem;
}

.ctc-pills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.ctc-pill-btn {
  height: 44px;
  padding: 0 0.85rem;
  font-size: 0.82rem;
  font-weight: 500;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.ctc-pill-btn:hover {
  background: #e2e8f0;
}

.ctc-pill-btn.active {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

/* Actions Row */
.ctc-actions-row {
  display: flex;
  gap: 0.75rem;
}

.ctc-btn {
  height: 44px;
  min-height: 44px;
  padding: 0 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  box-sizing: border-box;
  transition: background-color 0.15s ease;
}

.ctc-btn-primary {
  background: #ef4444;
  color: #ffffff;
}

.ctc-btn-primary:hover {
  background: #dc2626;
}

.ctc-btn-secondary {
  background: #e2e8f0;
  color: #334155;
}

.ctc-btn-secondary:hover {
  background: #cbd5e1;
}

/* Results Grid */
.ctc-results-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Decision Card */
.ctc-decision-card {
  border-radius: 12px;
  padding: 1.25rem;
  border-left: 6px solid #10b981;
  background: #f0fdf4;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ctc-decision-card.flagged {
  border-left-color: #f59e0b;
  background: #fffbeb;
}

.ctc-decision-card.reject {
  border-left-color: #ef4444;
  background: #fef2f2;
}

.ctc-decision-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.ctc-decision-badge {
  font-size: 0.85rem;
  font-weight: 800;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ctc-decision-badge.safe {
  background: #dcfce7;
  color: #166534;
}

.ctc-decision-badge.flagged {
  background: #fef3c7;
  color: #92400e;
}

.ctc-decision-badge.reject {
  background: #fee2e2;
  color: #991b1b;
}

.ctc-decision-score {
  font-size: 0.95rem;
  color: #475569;
}

.ctc-decision-score strong {
  font-size: 1.15rem;
  color: #0f172a;
}

.ctc-decision-desc {
  font-size: 0.92rem;
  color: #475569;
  margin: 0;
  line-height: 1.5;
}

/* Attributes Breakdown */
.ctc-attributes-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ctc-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 1rem;
  color: #0f172a;
}

.ctc-bars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.ctc-bar-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ctc-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.ctc-bar-label {
  font-weight: 600;
  color: #475569;
}

.ctc-bar-val {
  font-weight: 700;
  color: #0f172a;
}

.ctc-progress-track {
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.ctc-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.ctc-progress-fill.safe {
  background: #10b981;
}

.ctc-progress-fill.warning {
  background: #f59e0b;
}

.ctc-progress-fill.alert {
  background: #ef4444;
}

/* JSON Output Card */
.ctc-json-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ctc-json-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.ctc-copy-btn {
  height: 44px;
  padding: 0 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  cursor: pointer;
}

.ctc-copy-btn:hover {
  background: #e2e8f0;
}

.ctc-json-pre {
  margin: 0;
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-family: monospace, monospace;
  font-size: 0.88rem;
  line-height: 1.45;
  overflow-x: auto;
  color: #0f172a;
}

/* Ad Containers */
.ctc-ad-container {
  min-height: 280px;
  overflow: hidden;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 0.85rem;
  margin: 1.5rem 0;
}

/* In-Cluster Links */
.ctc-related-section {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.5rem;
}

.ctc-related-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 1rem;
  color: #0f172a;
}

.ctc-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.ctc-related-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease;
}

.ctc-related-card:hover {
  border-color: #ef4444;
}

.ctc-related-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #ef4444;
}

.ctc-related-desc {
  font-size: 0.82rem;
  color: #64748b;
}

.ctc-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
