/* ───── ALL STYLES SCOPED TO #jsf ───── */
#jsf {
  margin: 0;
  font-family: inherit;
  color: #1f2937;
}

#jsf *, #jsf *::before, #jsf *::after {
  box-sizing: border-box;
}

#jsf .jsf-subtitle {
  text-align: center;
  font-size: 16.5px;
  line-height: 1.65;
  color: #4b5563;
  margin: 0 auto 28px;
  max-width: 46rem;
}

#jsf .jsf-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

#jsf .jsf-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#jsf .jsf-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all .15s ease;
  font-family: inherit;
}

#jsf .jsf-btn:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

#jsf .jsf-btn.is-active,
#jsf .jsf-btn-primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

#jsf .jsf-btn.is-active:hover,
#jsf .jsf-btn-primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

#jsf .jsf-btn-ghost {
  background: transparent;
  border: 1px solid #e2e8f0;
  color: #475569;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all .15s ease;
  font-family: inherit;
}

#jsf .jsf-btn-ghost:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #1e293b;
}

#jsf .jsf-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

@media (min-width: 860px) {
  #jsf .jsf-grid {
    grid-template-columns: 1fr 1fr;
  }
}

#jsf .jsf-panel {
  display: flex;
  flex-direction: column;
}

#jsf .jsf-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

#jsf .jsf-panel-title {
  font-weight: 700;
  font-size: 14px;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: .05em;
}

#jsf .jsf-head-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

#jsf .jsf-chip {
  font-size: 12px;
  color: #64748b;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 9999px;
  font-weight: 500;
}

#jsf .jsf-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 9999px;
  letter-spacing: .02em;
}

#jsf .jsf-badge-empty {
  background: #f1f5f9;
  color: #64748b;
}

#jsf .jsf-badge-valid {
  background: #dcfce7;
  color: #15803d;
}

#jsf .jsf-badge-invalid {
  background: #fee2e2;
  color: #b91c1c;
}

#jsf .jsf-input {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 14px 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13.5px;
  line-height: 1.6;
  color: #0f172a;
  background: #ffffff;
  resize: vertical;
  min-height: 280px;
  transition: border-color .15s, box-shadow .15s;
}

#jsf .jsf-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

#jsf .jsf-output {
  background: #f8fafc;
}

#jsf .jsf-msg-row {
  margin-bottom: 20px;
}

#jsf .jsf-err {
  margin: 0;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 500;
}

#jsf .jsf-hidden {
  display: none !important;
}

#jsf .jsf-card-wrap {
  margin-bottom: 24px;
}

#jsf .jsf-card-bg {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 20px 24px;
}

#jsf .jsf-stats-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

@media (min-width: 640px) {
  #jsf .jsf-stats-row {
    grid-template-columns: repeat(4, 1fr);
  }
}

#jsf .jsf-cell {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 16px;
  text-align: center;
}

#jsf .jsf-label {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .04em;
}

#jsf .jsf-val {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

#jsf .jsf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

#jsf .jsf-button {
  background: #2563eb;
  color: #ffffff;
  border: none;
  padding: 11px 24px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .1s;
  font-family: inherit;
}

#jsf .jsf-button:hover:not(:disabled) {
  background: #1d4ed8;
  transform: translateY(-1px);
}

#jsf .jsf-button:disabled,
#jsf .jsf-btn-ghost:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

#jsf .jsf-button.jsf-copied {
  background: #16a34a;
}

#jsf .jsf-foot {
  text-align: center;
  font-size: 14.5px;
  line-height: 1.6;
  color: #64748b;
  margin: 0 auto;
  max-width: 52rem;
}
