/* Scoped styling for uk-crime-statistics-by-area */
.ucsa-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--color-text, #1e293b);
}

.ucsa-header {
  margin-bottom: 1.5rem;
}

.ucsa-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 9999px;
  background-color: #e0f2fe;
  color: #0369a1;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.ucsa-title {
  font-size: 1.85rem;
  font-weight: 800;
  margin: 0 0 0.5rem 0;
  color: var(--color-heading, #0f172a);
}

.ucsa-subtitle {
  margin: 0;
  font-size: 1rem;
  color: var(--color-text-muted, #64748b);
  line-height: 1.5;
}

/* Ad slots */
.ucsa-ad-slot {
  margin: 1.5rem 0;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-subtle, #f8fafc);
  border: 1px dashed var(--color-border, #e2e8f0);
  border-radius: 0.5rem;
}

/* Main Grid */
.ucsa-main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 960px) {
  .ucsa-main-grid {
    grid-template-columns: 6fr 6fr;
  }
}

.ucsa-side-col {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Cards */
.ucsa-card {
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ucsa-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
  padding-bottom: 0.75rem;
}

.ucsa-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  color: var(--color-heading, #0f172a);
}

.ucsa-data-source {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  background: #f1f5f9;
  border-radius: 0.25rem;
  color: #475569;
  font-weight: 600;
}

.ucsa-badge-meta {
  font-size: 0.8rem;
  color: #64748b;
}

.ucsa-badge-meta strong {
  color: #0f172a;
}

/* Controls */
.ucsa-controls-row {
  margin-bottom: 1.25rem;
}

.ucsa-control-group {
  width: 100%;
}

.ucsa-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.35rem;
}

.ucsa-select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-size: 0.9rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  background: #ffffff;
  color: #1e293b;
  outline: none;
}

.ucsa-select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Area Banner */
.ucsa-area-banner {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.ucsa-area-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.ucsa-area-title-wrap {
  flex: 1;
}

.ucsa-area-name {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0 0 0.25rem 0;
  color: #0f172a;
}

.ucsa-force-name {
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 600;
}

.ucsa-rate-box {
  text-align: right;
}

.ucsa-rate-number {
  font-size: 2.25rem;
  font-weight: 900;
  color: #0f172a;
  line-height: 1;
}

.ucsa-rate-unit {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.2rem;
}

.ucsa-rate-low .ucsa-rate-number { color: #16a34a; }
.ucsa-rate-mid .ucsa-rate-number { color: #ca8a04; }
.ucsa-rate-high .ucsa-rate-number { color: #dc2626; }

.ucsa-comparison-bar-wrap {
  margin-bottom: 0.75rem;
}

.ucsa-comparison-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.35rem;
}

.ucsa-progress-bar {
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.ucsa-progress-fill {
  height: 100%;
  background: #3b82f6;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.ucsa-context-note {
  margin: 0;
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.4;
}

/* Outcomes grid */
.ucsa-section-sub {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.75rem 0;
}

.ucsa-outcomes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.ucsa-outcome-item {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
}

.ucsa-outcome-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.15rem;
}

.ucsa-outcome-lbl {
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.3;
}

/* Categories List */
.ucsa-categories-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ucsa-cat-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ucsa-cat-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.825rem;
}

.ucsa-cat-name {
  font-weight: 600;
  color: #334155;
}

.ucsa-cat-count {
  color: #64748b;
  font-weight: 500;
}

.ucsa-cat-bar {
  height: 6px;
  background: #f1f5f9;
  border-radius: 3px;
  overflow: hidden;
}

.ucsa-cat-bar-fill {
  height: 100%;
  background: #2563eb;
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* Prevention Tips */
.ucsa-tips-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.ucsa-tip-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.ucsa-tip-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.ucsa-tip-text {
  font-size: 0.8rem;
  color: #475569;
  line-height: 1.45;
}

.ucsa-tip-text strong {
  color: #0f172a;
  display: inline;
}

.ucsa-summary-section {
  position: relative;
}

.ucsa-outcomes-wrap {
  margin-top: 0.5rem;
}
